Izakhi ze-HTML eziyisisekelo zenziwe isitayela futhi zathuthukiswa ngamakilasi andayo.
Zonke izihloko ze-HTML, <h1>
ngokusebenzisa <h6>
ziyatholakala.
Okuzenzakalelayo komhlaba wonke kwe-Bootstrap font-size
kungu- 14px , nokungu line-height
- 20px . Lokhu kusetshenziswe kuzo <body>
zonke izigaba. Ngaphezu kwalokho, <p>
(izigaba) zithola umkhawulo ophansi wesigamu sobude bomugqa wazo (10px ngokuzenzakalelayo).
I-Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. I-Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. I-Donec ullamcorper nulla non metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
<p>...</p>... </p>
Yenza isigaba sigqame ngokungeza .lead
.
I-Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. I-Duis mollis, ayiyona i-commodo luctus.
<p class="lead">...</p> class = "hola" > ... </p>
Isilinganiso se-typographic sisekelwe ezintweni ezimbili eziguquguqukayo ezincane eziguquguqukayo.kancane : @baseFontSize
kanye @baseLineHeight
. Esokuqala siwusayizi wefonti eyisisekelo osetshenziswa kuyo yonke indawo kanti eyesibili ubude bomugqa oyisisekelo. Sisebenzisa lezo ziguquguqukayo kanye nezibalo ezithile ezilula ukuze sakhe amamajini, ama-paddings, nobude bomugqa balo lonke uhlobo lwethu nokunye. Enze ngendlela oyifisayo kanye nezimo ze-Bootstrap.
Sebenzisa omaka bokugcizelela be-HTML abazenzakalelayo abanezitayela ezingasindi.
<small>
Ukuze ungagcizeleli emgqeni noma emabhuloki wombhalo, sebenzisa umaka omncane.
Lo mugqa wombhalo uhloselwe ukuthathwa njengokuphrinta kahle.
<p> <small>Lo mugqa wombhalo uhloselwe ukuthi uthathwe njengokuphrinta kahle.</small><encane> Lo mugqa wombhalo uhloselwe ukuthathwa njengokuphrinta kahle. </encane> </p></p>
Ukuze ugcizelele amazwibela ombhalo onesisindo sefonti esindayo.
Amazwibela alandelayo ombhalo ahunyushwa njengombhalo ogqamile .
<strong>ihunyushwe njengombhalo ogqamile</strong>ihunyushwe njengombhalo ogqamile </strong>
Ukuze ugcizelele amazwibela ombhalo omalukeke.
Amazwibela alandelayo ombhalo ahunyushwa njengombhalo omalukeke .
<em>hunyushwe njengombhalo omalukeke</em>ihunyushwe njengombhalo omalukeke </em>
Amakhanda phezulu!Zizwe ukhululekile ukusebenzisa <b>
futhi <i>
ku-HTML5. <b>
ihloselwe ukugqamisa amagama noma imishwana ngaphandle kokudlulisa ukubaluleka okwengeziwe kuyilapho <i>
ngokuvamile kungokwezwi, amagama obuchwepheshe, njll.
Hlela kabusha umbhalo kalula ube izingxenye ezinamakilasi okuqondanisa umbhalo.
Umbhalo oqondaniswe kwesokunxele.
Umbhalo oqondaniswe namaphakathi.
Umbhalo oqondaniswe kwesokudla.
- <p class="text-left">Umbhalo oqondaniswe kwesokunxele.</p> class = "text-left" > Umbhalo oqondaniswe kwesokunxele. </p>
- <p class = "text-center" > Umbhalo oqondaniswe namaphakathi. </p>
- <p class = "text-right" > Umbhalo oqondaniswe kwesokudla. </p>
Dlulisa incazelo ngombala ngedlanzana lezinsiza zokugcizelela.
Fusce dapibus, tellus ac cursus commodo, tor mauris nibh.
I-Etiam porta sem malesuada magna mollis euismod.
I-Donec ullamcorper nulla non metus auctor fringilla.
Aenean eu leo quam. I-Pellentesque ornare sem lacinia quam venenatis.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
- <p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p> class = "thulisiwe" > Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh. </p>
- <p class = "text-warning" > I- Etiam porta sem malesuada magna mollis euismod. </p>
- <p class = "text-error" > Donec ullamcorper nulla non metus auctor fringilla. </p>
- <p class = "text-info" > Aenean eu leo quam. I-Pellentesque ornare sem lacinia quam venenatis. </p>
- <p class = "text-success" > Duis mollis, est non commodo luctus, nisi erat porttitor ligula. </p>
Ukuqaliswa okunesitayela kwe- <abbr>
elementi ye-HTML yezifinyezo nama-akhronimi ukuze kuboniswe inguqulo enwetshiwe kukuhambisa phezulu. Izifinyezo ezinesibaluli title
zinomngcele ongezansi onamachashazi akhanyayo kanye nekhesa yosizo ekuhambeni, ehlinzeka ngomongo ongeziwe kokuthi hambisa phezulu.
<abbr>
Ngombhalo onwetshiwe kokuhambisa phezulu okude kwesifinyezo, faka title
isibaluli.
Isifinyezo segama lesichasiso sithi attr .
<abbr title="attribute">attr</abbr> title = "attribute" > attr </abbr>
<abbr class="initialism">
Engeza .initialism
kusifinyezo sosayizi wefonti omncane kancane.
I- HTML iyinto engcono kakhulu kusukela kusinkwa esisikiwe.
<abbr title="HyperText Markup Language" class="initialism">HTML</abbr> title = "HyperText Markup Language" class = "initialism" > HTML </abbr>
Yethula imininingwane yokuxhumana yedlozi eliseduze noma wonke umsebenzi.
<address>
Londoloza ukufometha ngokuqeda yonke imigqa nge- <br>
.
- <ikheli>
- <strong> Twitter, Inc. </strong><br>
- 795 Folsom Ave, Suite 600 <br>
- I-San Francisco, CA 94107 <br>
- <abbr title = "Ifoni" > P: </abbr> (123) 456-7890
- </ikheli>
- <ikheli>
- <strong> Igama Eligcwele </strong><br>
- <a href = "mailto:#" > [email protected] </a>
- </ikheli>
Ngokucaphuna amabhlogo wokuqukethwe komunye umthombo ngaphakathi kwedokhumenti yakho.
Goqa <blockquote>
noma iyiphi i- HTML njengengcaphuno. Ukuze uthole izingcaphuno eziqondile sincoma a <p>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. I-integer posuere ilingana ne-ante.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. I-integer posuere ilingana ne-ante. </p>
- </blockquote>
Isitayela nokuqukethwe kuyashintsha ukuze kube lula ukuhluka ku-blockquote evamile.
Engeza <small>
umaki wokukhomba umthombo. Gcoba igama lomsebenzi womthombo ngesi- <cite>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. I-integer posuere ilingana ne-ante.
Umuntu odumile ku- Source Title
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. I-integer posuere ilingana ne-ante. </p>
- <small> Umuntu othile odumile <cite title = "Isihloko Somthombo" > Isihloko Somthombo </cite></small>
- </blockquote>
Sebenzisa .pull-right
i-blockquote entantayo, eqondaniswe kwesokudla.
- <blockquote class="pull-right"> class = "donsa-kwesokudla" >
- ...
- </blockquote>
Uhlu lwezinto lapho i-oda lingenandaba khona ngokusobala.
- <ul>
- <li> ... </li>
- </ul>
Uhlu lwezinto lapho i-oda libaluleke ngokusobala.
- <ol>
- <li> ... </li>
- </ol>
Susa i- list-style
padding ezenzakalelayo nengakwesokunxele ezintweni zohlu (izingane eziseduze kuphela).
- <ul class="unstyled"> class = "unstyled" >
- <li> ... </li>
- </ul>
Beka zonke izinto zohlu emugqeni owodwa inline-block
onamaphedi alula.
- <ul class="inline"> class = "inline" >
- <li> ... </li>
- </ul>
Uhlu lwamagama anezincazelo ezihambisana nawo.
- <dl>
- <dt> ... </dt>
- <dd> ... </dd>
- </dl>
Yenza imigomo nezincazelo <dl>
zilandelane.
- <dl class="dl-horizontal"> class = "dl-horizontal" >
- <dt> ... </dt>
- <dd> ... </dd>
- </dl>
Amakhanda phezulu!Uhlu lwezincazelo ezivundlile luzonciphisa amagama amade kakhulu ukuthi angangena ekulungisweni kwekholomu yesobunxele text-overflow
. Ezingobeni zokubuka ezinciphile, zizoshintshela kusakhiwo esistakiwe esizenzakalelayo.
Goqa amazwibela ekhodi nge- <code>
.
<section>
kufanele isongwe njenge-inline.
- Isibonelo , <code > & lt ; isigaba & gt ;</ code > kufanele isongwe njengokusemgqeni .
Sebenzisa <pre>
emigqeni eminingi yekhodi. Qiniseka ukuthi ubalekela noma yibaphi abakaki be-engeli kukhodi ukuze unikezwe ngendlela efanele.
<p>Isampula yombhalo lapha...</p>
- <pre>
- <p>Isampula yombhalo lapha...</p>
- </pre>
Amakhanda phezulu!Qiniseka ukuthi ugcina ikhodi ngaphakathi <pre>
komaki eduze kwesokunxele ngangokunokwenzeka; izonikeza wonke amathebhu.
Ungakhetha ngokukhetha .pre-scrollable
iklasi elizosetha ubude bobude obungu-350px futhi linikeze ibha yokuskrola ye-y-axis.
Ukuze uthole isitayela esiyisisekelo—i-padding ekhanyayo nezihlukanisi ezivundlile kuphela—engeza isigaba sesisekelo .table
kunoma iyiphi <table>
.
# | Igama | Isibongo | Igama lomsebenzisi |
---|---|---|---|
1 | Maka | Otto | @mdo |
2 | uJakobe | Thornton | @amafutha |
3 | Larry | uNyoni |
- <table class = "table" >
- …
- </ithebula>
Engeza noma yimaphi amakilasi alandelayo ekilasini .table
lesisekelo.
.table-striped
Yengeza i-zebra-striping kunoma yimuphi umugqa wethebula ngaphakathi kwesikhethi <tbody>
se- :nth-child
CSS (ayitholakali ku-IE7-8).
# | Igama | Isibongo | Igama lomsebenzisi |
---|---|---|---|
1 | Maka | Otto | @mdo |
2 | uJakobe | Thornton | @amafutha |
3 | Larry | uNyoni |
- <table class = "table-striped table" >
- …
- </ithebula>
.table-bordered
Engeza imingcele namakhona ayindilinga etafuleni.
# | Igama | Isibongo | Igama lomsebenzisi |
---|---|---|---|
1 | Maka | Otto | @mdo |
Maka | Otto | @getbootstrap | |
2 | uJakobe | Thornton | @amafutha |
3 | Larry Inyoni |
- <table class = "table-bordered" >
- …
- </ithebula>
.table-hover
Nika amandla isimo sokuhambisa phezulu emigqeni yethebula ngaphakathi kwe- <tbody>
.
# | Igama | Isibongo | Igama lomsebenzisi |
---|---|---|---|
1 | Maka | Otto | @mdo |
2 | uJakobe | Thornton | @amafutha |
3 | Larry Inyoni |
- <table class = "table-hover yetafula" >
- …
- </ithebula>
.table-condensed
Yenza amathebula ahlangane kakhudlwana ngokusika ama-cell padding phakathi.
# | Igama | Isibongo | Igama lomsebenzisi |
---|---|---|---|
1 | Maka | Otto | @mdo |
2 | uJakobe | Thornton | @amafutha |
3 | Larry Inyoni |
- <table class = "table-condensed table" >
- …
- </ithebula>
Sebenzisa amakilasi anomongo ukuze ufake imibala yemigqa yethebula.
Ikilasi | Incazelo |
---|---|
.success |
Ibonisa isenzo esiyimpumelelo noma esihle. |
.error |
Ibonisa isenzo esiyingozi noma okungenzeka sibe sibi. |
.warning |
Ibonisa isexwayiso esingase sidinge ukunakwa. |
.info |
Isetshenziswa njengenye indlela yezitayela ezizenzakalelayo. |
# | Umkhiqizo | Inkokhelo Ithathiwe | Isimo |
---|---|---|---|
1 | I-TB - Nyanga zonke | 01/04/2012 | Kuvunyelwe |
2 | I-TB - Nyanga zonke | 02/04/2012 | Kwenqatshiwe |
3 | I-TB - Nyanga zonke | 03/04/2012 | Kusalindile |
4 | I-TB - Nyanga zonke | 04/04/2012 | Shayela ukuze uqinisekise |
- ...
- < tr class = "success" >
- <td> 1 < /td>
- <td>TB - Nyanga zonke</ td >
- <td> 01 / 04 / 2012 < /td>
- <td>Kuvunyiwe</ td >
- </ tr >
- ...
Uhlu lwezinto ezisekelwayo zethebula le-HTML nokuthi kufanele zisetshenziswe kanjani.
Maka | Incazelo |
---|---|
<table> |
Isici sokugoqa sokubonisa idatha ngefomethi yethebula |
<thead> |
Isici sesiqukathi semigqa yesihloko sethebula ( <tr> ) ukuze ilebula amakholomu ethebula |
<tbody> |
Isici sesiqukathi semigqa yethebula ( <tr> ) emzimbeni wetafula |
<tr> |
Isici sesiqukathi sesethi yamaseli ethebula ( <td> noma <th> ) avela kumugqa owodwa |
<td> |
Iseli lethebula elizenzakalelayo |
<th> |
Iseli lethebula elikhethekile lekholomu (noma umugqa, kuye ngobukhulu nokubeka) amalebula |
<caption> |
Incazelo noma isifinyezo salokho okuphethwe yithebula, ikakhulukazi ezifundeni zesikrini |
- <ithebula>
- <caption> ... </caption>
- <ikhanda>
- <tr>
- <th> ... </th>
- <th> ... </th>
- </tr>
- </isihloko>
- <tbody>
- <tr>
- <td> ... </td>
- <td> ... </td>
- </tr>
- </tbody>
- </ithebula>
Izilawuli zefomu ngazinye zithola isitayela, kodwa ngaphandle kwanoma yisiphi isigaba sesisekelo esidingekayo <form>
noma izinguquko ezinkulu kumakhaphu. Imiphumela ngamalebula astakiwe, aqondaniswe kwesokunxele phezu kwezilawuli zefomu.
- <ifomu>
- <i-fieldset>
- <legend> Inganekwane </legend>
- <ilebula> Igama lelebula </label>
- <input type = "text" isimeli = "Thayipha okuthile..." >
- <span class = "help-block" > Umbhalo wosizo weleveli yesibonelo yebhulokhi lapha. </span>
- <label class = "checkbox" >
- <input type = "checkbox" > Ngihlole
- </ilebula>
- <button type = "submit" class = "btn" > Thumela </inkinobho>
- </fieldset>
- </ifomu>
Kufakwe ne-Bootstrap kunezakhiwo ezintathu zamafomu ongakhetha kuzo ezimweni ezivamile zokusetshenziswa.
Engeza .form-search
efomini naku- .search-query
ukuze <input>
uthole okokufaka kombhalo okuyindilinga eyengeziwe.
- <form class = "form-search" >
- <input type = "text" class = "input-medium search-query" >
- <button type = "submit" class = "btn" > Sesha </inkinobho>
- </ifomu>
Engeza .form-inline
amalebula aqondaniswe kwesokunxele kanye nezilawuli zebhulokhi esemgqeni ukuze uthole isakhiwo esihlangene.
- <form class = "form-inline" >
- <input type = "text" class = "input-small" isimeli = "I-imeyili" >
- <input type = "password" class = "input-small" isimeli = "Iphasiwedi" >
- <label class = "checkbox" >
- <input type = "checkbox" > Ngikhumbule
- </ilebula>
- <button type = "submit" class = "btn" > Ngena ngemvume </inkinobho>
- </ifomu>
Qondanisa amalebula kwesokudla futhi uwantante kwesokunxele ukuze uwenze avele emugqeni ofanayo nezilawuli. Idinga izinguquko eziningi zemakhaphu efomini elizenzakalelayo:
.form-horizontal
efomini.control-group
.control-label
kulebula.controls
ukuze uqondanise kahle
- <form class = "form-horizontal" >
- <div class = "control-group" >
- <label class = "control-label" ye = "inputEmail" > I- imeyili </label>
- <div class = "controls" >
- <input type = "text" id = "inputEmail" isimeli = "I-imeyili" >
- </div>
- </div>
- <div class = "control-group" >
- <label class = "control-label" ye = "inputPassword" > Iphasiwedi </label>
- <div class = "controls" >
- <input type = "password" id = "inputPassword" placeholder = "Iphasiwedi" >
- </div>
- </div>
- <div class = "control-group" >
- <div class = "controls" >
- <label class = "checkbox" >
- <input type = "checkbox" > Ngikhumbule
- </ilebula>
- <button type = "submit" class = "btn" > Ngena ngemvume </inkinobho>
- </div>
- </div>
- </ifomu>
Izibonelo zezilawuli zefomu ezijwayelekile ezisekelwa kusakhiwo sefomu lesibonelo.
Ukulawulwa kwefomu okuvame kakhulu, izinkambu zokufaka ezisuselwe embhalweni. Ifaka usekelo lwazo zonke izinhlobo ze-HTML5: umbhalo, iphasiwedi, isikhathi sosuku, isikhathi sosuku, idethi, inyanga, isikhathi, iviki, inombolo, i-imeyili, i-url, usesho, ucingo, nombala.
Idinga ukusetshenziswa okucacisiwe type
ngaso sonke isikhathi.
- <input type = "text" isimeli = "Okokufaka umbhalo" >
Ukulawula kwefomu okusekela imigqa eminingi yombhalo. Shintsha rows
isibaluli njengoba kudingeka.
- <textarea rows = "3" ></textarea>
Amabhokisi okuhlola awokukhetha inketho eyodwa noma ezimbalwa ohlwini kuyilapho imisakazo ingeyokukhetha inketho eyodwa kweziningi.
- <label class = "checkbox" >
- <input type = "checkbox" value = "" >
- Inketho yokuqala yile nalokhuya—qiniseka ukuthi uyafaka phakathi ukuthi kungani kukuhle
- </ilebula>
- <label class = "radio" >
- <input type = "radio" name = "optionsRadios" id = "optionsRadios1" value = "option1" ithikhiwe >
- Inketho yokuqala yile nalokhuya—qiniseka ukuthi uyafaka phakathi ukuthi kungani kukuhle
- </ilebula>
- <label class = "radio" >
- <input type = "radio" name = "optionsRadios" id = "optionsRadios2" value = "option2" >
- Inketho yesibili ingaba enye into futhi ukuyikhetha kuzosusa ukukhetha okukodwa
- </ilebula>
Engeza .inline
ikilasi ochungechungeni lwamabhokisi okuhlola noma imisakazo yezilawuli ezivela emugqeni ofanayo.
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox1" value = "option1" > 1
- </ilebula>
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox2" value = "option2" > 2
- </ilebula>
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox3" value = "option3" > 3
- </ilebula>
Sebenzisa inketho ezenzakalelayo noma ucacise u-a multiple="multiple"
ukuze ubonise izinketho eziningi ngesikhathi esisodwa.
- <khetha>
- <option> 1 </option>
- <option> 2 </option>
- <option> 3 </option>
- <option> 4 </option>
- <option> 5 </option>
- </khetha>
- <khetha multiple = "multiple" >
- <option> 1 </option>
- <option> 2 </option>
- <option> 3 </option>
- <option> 4 </option>
- <option> 5 </option>
- </khetha>
Ingeza phezu kwezilawuli ezikhona zesiphequluli, i-Bootstrap ihlanganisa nezinye izingxenye zefomu eziwusizo.
Engeza umbhalo noma izinkinobho ngaphambi noma ngemva kwanoma yikuphi okokufaka okusekelwe embhalweni. Qaphela ukuthi select
ama-elementi awasekelwe lapha.
Goqa u-an .add-on
kanye input
nelinye lamakilasi amabili ukuze ulungiselele noma wengeze umbhalo kokokufakayo.
- <div class = "input-prepend" >
- <span class = "add-on" > @ </span>
- <input class = "span2" id = "prependedInput" type = "text" isimeli = "Igama lomsebenzisi" >
- </div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedInput" type = "text" >
- <span class = "add-on" > .00 </span>
- </div>
Sebenzisa womabili amakilasi kanye nezimo ezimbili .add-on
zokulungisa futhi wengeze okokufaka.
- <div class = "input-prepend-append" >
- <span class = "add-on" > $ </span>
- <input class = "span2" id = "appendedPrependedInput" type = "text" >
- <span class = "add-on" > .00 </span>
- </div>
Esikhundleni sika-a <span>
onombhalo, sebenzisa u-a .btn
ukuze unamathisele inkinobho (noma ezimbili) kokokufakayo.
- <div class = "input-append" >
- <input class = "span2" id = "appendedInputButton" type = "text" >
- <button class = "btn" type = "button" > Hamba! </inkinobho>
- </div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedInputButtons" type = "text" >
- <button class = "btn" type = "button" > Sesha </inkinobho>
- <button class = "btn" type = "inkinobho" > Izinketho </inkinobho>
- </div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedDropdownButton" type = "text" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Isenzo
- <span class = "caret" ></span>
- </inkinobho>
- <ul class = "imenyu eyehlayo" >
- ...
- </ul>
- </div>
- </div>
- <div class = "input-prepend" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Isenzo
- <span class = "caret" ></span>
- </inkinobho>
- <ul class = "imenyu eyehlayo" >
- ...
- </ul>
- </div>
- <input class = "span2" id = "prependedDropdownButton" type = "text" >
- </div>
- <div class = "input-prepend-append" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Isenzo
- <span class = "caret" ></span>
- </inkinobho>
- <ul class = "imenyu eyehlayo" >
- ...
- </ul>
- </div>
- <input class = "span2" id = "appendedPrependedDropdownButton" type = "text" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Isenzo
- <span class = "caret" ></span>
- </inkinobho>
- <ul class = "imenyu eyehlayo" >
- ...
- </ul>
- </div>
- </div>
- <ifomu>
- <div class = "input-prepend" >
- <div class = "btn-group" > ... </div>
- <input type = "text" >
- </div>
- <div class = "input-append" >
- <input type = "text" >
- <div class = "btn-group" > ... </div>
- </div>
- </ifomu>
- <form class = "form-search" >
- <div class = "input-append" >
- <input type = "text" class = "span2 search-query" >
- <button type = "submit" class = "btn" > Sesha </inkinobho>
- </div>
- <div class = "input-prepend" >
- <button type = "submit" class = "btn" > Sesha </inkinobho>
- <input type = "text" class = "span2 search-query" >
- </div>
- </ifomu>
Sebenzisa amakilasi okulinganisa okuhlobene afana .input-large
noma ufanise okokufaka kwakho nosayizi bekholomu yegridi usebenzisa .span*
amakilasi.
Yenza noma iyiphi <input>
noma i <textarea>
-elementi iziphathe njenge-elementi yeleveli yebhulokhi.
- <input class = "input-block-level" type = "text" placeholder = ".input-block-level" >
- <input class = "input-mini" type = "text" isimeli = ".input-mini" >
- <input class = "input-small" type = "text" isimeli = ".input-small" >
- <input class = "input-medium" type = "text" isimeli = ".input-medium" >
- <input class = "input-large" type = "text" isimeli = ".input-large" >
- <input class = "input-xlarge" type = "text" placeholder = ".input-xlarge" >
- <input class = "input-xxlarge" type = "text" isimeli = ".input-xxlarge" >
Amakhanda phezulu!Ezinguqulweni ezizayo, sizobe sishintsha ukusetshenziswa kwalezi zigaba zokufaka okuhlobene ukuze kufane nosayizi wezinkinobho zethu. Isibonelo, .input-large
izokhuphula ukupheda kanye nosayizi wefonti okokufaka.
Sebenzisa .span1
okuthi ukuze .span12
uthole okokufaka okufanayo nosayizi abafanayo bamakholomu egridi.
- <input class = "span1" type = "text" isimeli = ".span1" >
- <input class = "span2" type = "text" isimeli = ".span2" >
- <input class = "span3" type = "text" isimeli = ".span3" >
- <select class = "span1" >
- ...
- </khetha>
- <select class = "span2" >
- ...
- </khetha>
- <select class = "span3" >
- ...
- </khetha>
Okokufaka kwamagridi amaningi emugqeni ngamunye, sebenzisa .controls-row
isigaba sokuguqula ukuze uthole izikhala ezifanele . Intanta okokufaka ukuze igoqe indawo emhlophe, isethe amamajini afanele, futhi isuse ukuntanta.
- <div class = "controls" >
- <input class = "span5" type = "text" isimeli = ".span5" >
- </div>
- <div class = "controls-controls-row" >
- <input class = "span4" type = "text" isimeli = ".span4" >
- <input class = "span1" type = "text" isimeli = ".span1" >
- </div>
- ...
Yethula idatha ngefomu elingeke lihleleke ngaphandle kokusebenzisa umaka wefomu langempela.
- <span class = "input-xlarge-input-input" > Inani elithile lapha </span>
Qeda ifomu ngeqembu lezenzo (izinkinobho). Uma ibekwe ngaphakathi .form-actions
kwe-, izinkinobho zizohlehlisa ngokuzenzakalelayo ukuze zihambisane nezilawuli zefomu.
- <div class = "form-actions" >
- <button type = "submit" class = "btn btn-primary" > Londoloza izinguquko </button>
- <button type = "button" class = "btn" > Khansela </inkinobho>
- </div>
Ukusekelwa kwezinga le-inline ne-block block lombhalo wosizo ovela eduze nezilawuli zefomu.
- <input type = "text" ><span class = "help-inline" > Umbhalo wosizo ongaphakathi komugqa </span>
- <input type = "text" ><span class = "help-block" > Ibhulokhi elide lombhalo wosizo oweqa emugqeni omusha futhi ungase udlulele ngale komugqa owodwa. </span>
Nikeza impendulo kubasebenzisi noma izivakashi ngezimo zempendulo eziyisisekelo kuzilawuli zefomu namalebula.
Sisusa izitayela ezizenzakalelayo outline
kwezinye izilawuli zefomu futhi sisebenzise u-a box-shadow
endaweni yazo :focus
.
- <input class = "input-xlarge" id = "focusedInput" type = "text" value = "Lokhu kugxilile..." >
Okokufaka kwesitayela ngokusebenza kwesiphequluli esizenzakalelayo nge- :invalid
. Cacisa i- type
, engeza required
isibaluli uma inkambu ingeyona inketho, futhi (uma ikhona) ucacise i- pattern
.
Lokhu akutholakali kuzinguqulo ze-Internet Explorer 7-9 ngenxa yokuntuleka kosekelo lwezikhethi mbumbulu ze-CSS.
- <input class = "span3" type = "i-imeyili" edingekayo >
Engeza disabled
isibaluli kokokufaka ukuze uvimbele okokufaka komsebenzisi futhi ucuphe ukubukeka okuhluke kancane.
- <input class = "input-xlarge" id = "disabledInput" type = "text" isimeli = "Okufaka okukhutshaziwe lapha..." kukhutshaziwe >
I-Bootstrap ihlanganisa izitayela zokuqinisekisa zephutha, isexwayiso, ulwazi, nemilayezo yempumelelo. Ukuze usebenzise, engeza ikilasi elifanele kokuzungezile .control-group
.
- <div class = "control-group warning" >
- <label class = "control-label" ye = "inputWarning" > Okokufaka okunesixwayiso </label>
- <div class = "controls" >
- <input type = "text" id = "inputWarning" >
- <span class = "help-inline" > Kungenzeka ukuthi kukhona okungahambanga kahle </span>
- </div>
- </div>
- <div class = "control-group error" >
- <label class = "control-label" ye = "inputError" > Okokufaka okunephutha </label>
- <div class = "controls" >
- <input type = "text" id = "inputError" >
- <span class = "help-inline" > Sicela ulungise iphutha </span>
- </div>
- </div>
- <div class = "control-group info" >
- <label class = "control-label" ye = "inputInfo" > Okokufaka ngolwazi </label>
- <div class = "controls" >
- <input type = "text" id = "inputInfo" >
- <span class = "help-inline" > Igama lomsebenzisi selithathiwe </span>
- </div>
- </div>
- <div class = "control-group success" >
- <label class = "control-label" for = "inputSuccess" > Okokufaka ngempumelelo </label>
- <div class = "controls" >
- <input type = "text" id = "inputSuccess" >
- <span class = "help-inline" > Woohoo! </span>
- </div>
- </div>
Engeza amakilasi <img>
entweni ukuze wenze isitayela kalula izithombe kunoma iyiphi iphrojekthi.
- <img src = "..." class = "img-rounded" >
- <img src = "..." class = "img-circle" >
- <img src = "..." class = "img-polaroid" >
Amakhanda phezulu! .img-rounded
futhi .img-circle
ungasebenzi ku-IE7-8 ngenxa yokushoda border-radius
kokusekelwa.
Izithonjana eziyi-140 zefomu le-sprite, ezitholakala ngokumpunga okumnyama (okuzenzakalelayo) nokumhlophe, ezihlinzekwa ama- Glyphicons .
Ama-Glyphicons Halflings awavamile ukutholakala mahhala, kodwa ilungiselelo phakathi kwe-Bootstrap nabadali be-Glyphicons lenze lokhu kwenzeka ngaphandle kwenkokhiso kuwena njengabathuthukisi. Njengokubonga, sikucela ukuthi ufake isixhumanisi ozikhethela sona esibuyela kuma- Glyphicons noma nini lapho kusebenza.
Zonke izithonjana zidinga <i>
umaki onesigaba esiyingqayizivele, esiqalwe ngokuthi icon-
. Ukuze usebenzise, beka ikhodi elandelayo cishe noma yikuphi:
- <i class = "icon-search" ></i>
Kukhona nezitayela ezitholakalayo zezithonjana ezihlanekezelwe (ezimhlophe), ezenziwe zalungiswa ngesigaba esisodwa esengeziwe. Sizophoqelela ngokukhethekile leli klasi ku-hover nezimo ezisebenzayo kuzixhumanisi ze-nav nezokwehla.
- <i class = "icon-search icon-white" ></i>
Amakhanda phezulu!Uma usebenzisa eceleni kweyunithi yezinhlamvu zombhalo, njengezinkinobho noma izixhumanisi ze-nav, qiniseka ukuthi ushiya isikhala ngemva <i>
komaka ukuze uthole izikhala ezifanele.
Wasebenzise ezinkinobho, emaqenjini enkinobho yebha yamathuluzi, ukuzulazula, noma okokufaka kwefomu okulungiselelwe ngaphambilini.
- <div class = "btn-toolbar" >
- <div class = "btn-group" >
- <a class = "btn" href = "#" ><i class = "icon-align-left" ></i></a>
- <a class = "btn" href = "#" ><i class = "icon-align-center" ></i></a>
- <a class = "btn" href = "#" ><i class = "icon-align-right" ></i></a>
- <a class = "btn" href = "#" ><i class = "icon-align-justify" ></i></a>
- </div>
- </div>
- <div class = "btn-group" >
- <a class = "btn btn-primary" href = "#" ><i class = "icon-user icon-white" ></i> Umsebenzisi </a>
- <a class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" href = "#" ><span class = "caret" ></span></a>
- <ul class = "imenyu eyehlayo" >
- <li><a href = "#" ><i class = "icon-pencil" ></i> Hlela </a></li>
- <li><a href = "#" ><i class = "icon-doti" ></i> Susa </a></li>
- <li><a href = "#" ><i class = "icon-ban-circle" ></i> Vimbela </a></li>
- <li class = "divider" ></li>
- <li><a href = "#" ><i class = "i" ></i> Yenza umlawuli </a></li>
- </ul>
- </div>
- <a class = "btn btn-large" href = "#" ><i class = "icon-star" ></i> Inkanyezi </a>
- <a class = "btn btn-small" href = "#" ><i class = "icon-star" ></i> Inkanyezi </a>
- <a class = "btn btn-mini" href = "#" ><i class = "icon-star" ></i> Inkanyezi </a>
- <ul class = "nav-list" >
- <li class = "active" ><a href = "#" ><i class = "isithonjana-sasekhaya icon-white" ></i> Ikhaya </a></li>
- <li><a href = "#" ><i class = "icon-book" ></i> Library </a></li>
- <li><a href = "#" ><i class = "icon-pencil" ></i> Izicelo </a></li>
- <li><a href = "#" ><i class = "i" ></i> Okuningi </a></li>
- </ul>
- <div class = "control-group" >
- <label class = "control-label" ye = "inputIcon" > Ikheli le- imeyili </label>
- <div class = "controls" >
- <div class = "input-prepend" >
- <span class = "add-on" ><i class = "icon-envelope" ></i></span>
- <input class = "span2" id = "inputIcon" type = "text" >
- </div>
- </div>
- </div>