Vipengele vya msingi vya HTML vilivyowekwa mtindo na kuimarishwa kwa madarasa ya kupanuka.
Vichwa vyote vya HTML, <h1>
kupitia <h6>
vinapatikana.
Chaguo-msingi la kimataifa la Bootstrap font-size
ni 14px , line-height
na 20px . Hii inatumika kwa <body>
aya na aya zote. Kwa kuongeza, <p>
(aya) hupokea ukingo wa chini wa nusu ya urefu wa mstari (10px kwa chaguo-msingi).
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. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. 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>
Fanya aya isimame kwa kuongeza .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor dalali. Duis mollis, est non commodo luctus.
<p class = "lead" > ... </p>
Kiwango cha uchapaji kinatokana na vigeu viwili LESS katika vigeuzo.less : @baseFontSize
na @baseLineHeight
. Ya kwanza ni saizi ya msingi ya fonti inayotumika kote na ya pili ni urefu wa mstari wa msingi. Tunatumia vigeu hivyo na hesabu fulani rahisi kuunda kando, pedi, na urefu wa mstari wa aina zetu zote na zaidi. Zibinafsishe na ubadilishe Bootstrap.
Tumia lebo za mkazo chaguomsingi za HTML na mitindo nyepesi.
<small>
Ili kuondoa msisitizo ndani ya mstari au vizuizi vya maandishi, tumia lebo ndogo.
Mstari huu wa maandishi unakusudiwa kuzingatiwa kama chapa nzuri.
<p> <small> Mstari huu wa maandishi unakusudiwa kuzingatiwa kama chapa bora. </ ndogo> </p>
Kwa kusisitiza kijisehemu cha maandishi chenye uzito mkubwa wa fonti.
Kijisehemu kifuatacho cha maandishi kinatolewa kama maandishi mazito .
<strong> inayotolewa kama maandishi mazito </strong>
Kwa kusisitiza kijisehemu cha maandishi chenye italiki.
Kijisehemu kifuatacho cha maandishi kinatolewa kama maandishi ya italiki .
<em> inayotolewa kama maandishi ya italiki </em>
Vichwa juu!Jisikie huru kutumia <b>
na <i>
katika HTML5. <b>
inakusudiwa kuangazia maneno au vifungu vya maneno bila kuwasilisha umuhimu wa ziada ilhali <i>
mara nyingi ni kwa sauti, maneno ya kiufundi, n.k.
Pangilia maandishi upya kwa vipengele kwa urahisi na madarasa ya upatanishi wa maandishi.
Maandishi yaliyopangiliwa kushoto.
Maandishi yaliyopangiliwa katikati.
Maandishi yaliyopangiliwa kulia.
- <p class = "text-left" > Maandishi yaliyopangiliwa kushoto. </ p>
- <p class = "text-center" > Maandishi yaliyopangiliwa katikati . </ p>
- <p class = "text-right" > Maandishi yaliyopangiliwa kulia. </ p>
Onyesha maana kupitia rangi na madarasa machache ya matumizi ya mkazo.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Aenean eu leo quam. 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, tor mauris nibh. </ p>
- <p class = "text-warning" > 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. Pellentesque ornare sem lacinia quam venenatis. </ p>
- <p class = "text-success" > Duis mollis, est non commodo luctus, nisi erat porttitor ligula. </ p>
Utekelezaji wa mtindo wa <abbr>
kipengele cha HTML cha vifupisho na vifupisho ili kuonyesha toleo lililopanuliwa kwenye kielelezo. Vifupisho vyenye title
sifa vina mpaka wa chini wenye vitone vyepesi na kishale cha usaidizi kwenye kieleezaji, ukitoa muktadha wa ziada kwenye kuelea.
<abbr>
Kwa maandishi yaliyopanuliwa kwenye kielelezo kirefu cha kifupisho, jumuisha title
sifa.
Kifupi cha neno sifa ni attr .
<abbr title = "attribute" > attr </abbr>
<abbr class="initialism">
Ongeza .initialism
kwa kifupi cha saizi ndogo ya fonti.
HTML ndio kitu bora zaidi tangu mkate uliokatwa.
<abbr title = "HyperText Markup Language" class = "initialism" > HTML </abbr>
Wasilisha maelezo ya mawasiliano kwa babu wa karibu au kikundi kizima cha kazi.
<address>
Hifadhi umbizo kwa kumalizia mistari yote kwa <br>
.
- <anwani>
- <strong> Twitter, Inc. </strong><br>
- 795 Folsom Ave, Suite 600 <br>
- San Francisco, CA 94107 <br>
- <abbr title = "Simu" > P: </abbr> (123) 456-7890
- </ address>
- <anwani>
- <strong> Jina Kamili </strong><br>
- <a href = "mailto:#" > [email protected] </a>
- </ address>
Kwa kunukuu vizuizi vya maudhui kutoka chanzo kingine ndani ya hati yako.
Funga HTML<blockquote>
yoyote kama nukuu. Kwa nukuu moja kwa moja tunapendekeza a .<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nambari kamili imesababisha ante.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nambari kamili imesababisha ante. </ p>
- </blockquote>
Mtindo na mabadiliko ya yaliyomo kwa tofauti rahisi kwenye nukuu ya kawaida ya kuzuia.
Ongeza <small>
lebo ili kutambua chanzo. Funga jina la kazi ya chanzo katika <cite>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nambari kamili imesababisha ante.
Mtu maarufu katika Mada ya Chanzo
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nambari kamili imesababisha ante. </ p>
- <small> Mtu maarufu <cite title = "Chanzo Kichwa" > Kichwa Chanzo </cite></small>
- </blockquote>
Tumia .pull-right
kwa nukuu ya kuzuia iliyoelea, iliyopangiliwa kulia.
- <blockquote class = "pull-right" >
- ...
- </blockquote>
Orodha ya vitu ambavyo mpangilio haujalishi kwa uwazi.
- <ul>
- <li> ... </li>
- </ul>
Orodha ya vitu ambavyo agizo lina umuhimu wazi.
- <ol>
- <li> ... </li>
- </ol>
Ondoa pedi chaguomsingi list-style
na kushoto kwenye vipengee vya orodha (watoto wa karibu pekee).
- <ul class = "unstyled" >
- <li> ... </li>
- </ul>
Weka vitu vyote vya orodha kwenye mstari mmoja inline-block
na pedi nyepesi.
- <ul class = "inline" >
- <li> ... </li>
- </ul>
Orodha ya maneno na maelezo yanayohusiana nayo.
- <dl>
- <dt> ... </dt>
- <dd> ... </dd>
- </ dl>
Tengeneza masharti na maelezo kwa <dl>
mstari kwa upande.
- <dl class = "dl-horizontal" >
- <dt> ... </dt>
- <dd> ... </dd>
- </ dl>
Vichwa juu!Orodha za maelezo mlalo zitapunguza maneno ambayo ni marefu sana kutoshea katika kurekebisha safu wima ya kushoto text-overflow
. Katika maeneo finyu ya kutazama, yatabadilika kuwa mpangilio chaguomsingi wa kura.
Funga vijisehemu vya ndani vya msimbo kwa <code>
.
<section>
inapaswa kufungwa kama inline.
- Kwa mfano , <code> & lt ; section & gt ;</ code > inapaswa kufungwa kama inline .
Tumia <pre>
kwa mistari mingi ya msimbo. Hakikisha umeepuka mabano yoyote katika msimbo ili utoe sahihi.
<p>Mfano wa maandishi hapa...</p>
- <kabla>
- <p>Mfano wa maandishi hapa...</p>
- </ pre>
Vichwa juu!Hakikisha kuweka msimbo ndani ya <pre>
vitambulisho karibu na kushoto iwezekanavyo; itatoa tabo zote.
Unaweza kuongeza kwa hiari .pre-scrollable
darasa ambalo litaweka urefu wa juu wa 350px na kutoa upau wa kusogeza wa y-axis.
Kwa mtindo wa kimsingi - pedi nyepesi na vigawanyiko vya mlalo pekee - ongeza darasa la msingi .table
kwa yoyote <table>
.
# | Jina la kwanza | Jina la familia | Jina la mtumiaji |
---|---|---|---|
1 | Weka alama | Otto | @mdo |
2 | Yakobo | Thornton | @mafuta |
3 | Larry | ndege |
- <table class = "meza" >
- …
- </ meza>
Ongeza darasa lolote kati ya zifuatazo kwa .table
darasa la msingi.
.table-striped
Huongeza michirizi ya pundamilia kwenye safu mlalo yoyote ya jedwali ndani ya <tbody>
kiteuzi cha :nth-child
CSS (hakipatikani katika IE7-8).
# | Jina la kwanza | Jina la familia | Jina la mtumiaji |
---|---|---|---|
1 | Weka alama | Otto | @mdo |
2 | Yakobo | Thornton | @mafuta |
3 | Larry | ndege |
- <table class = "table table-striped" >
- …
- </ meza>
.table-bordered
Ongeza mipaka na pembe za mviringo kwenye meza.
# | Jina la kwanza | Jina la familia | Jina la mtumiaji |
---|---|---|---|
1 | Weka alama | Otto | @mdo |
Weka alama | Otto | @getbootstrap | |
2 | Yakobo | Thornton | @mafuta |
3 | Larry Ndege |
- <table class = "table-bordered" >
- …
- </ meza>
.table-hover
Washa hali ya kuelea kwenye safu mlalo za jedwali ndani ya <tbody>
.
# | Jina la kwanza | Jina la familia | Jina la mtumiaji |
---|---|---|---|
1 | Weka alama | Otto | @mdo |
2 | Yakobo | Thornton | @mafuta |
3 | Larry Ndege |
- <table class = "table table-hover" >
- …
- </ meza>
.table-condensed
Hufanya jedwali kushikana zaidi kwa kukata pedi za seli katikati.
# | Jina la kwanza | Jina la familia | Jina la mtumiaji |
---|---|---|---|
1 | Weka alama | Otto | @mdo |
2 | Yakobo | Thornton | @mafuta |
3 | Larry Ndege |
- <table class = "table-condensed table" >
- …
- </ meza>
Tumia madarasa ya muktadha kupaka safu za jedwali rangi.
Darasa | Maelezo |
---|---|
.success |
Inaonyesha hatua iliyofanikiwa au chanya. |
.error |
Huonyesha kitendo hatari au kinachoweza kuwa hasi. |
.warning |
Inaonyesha onyo ambalo linaweza kuhitaji kuzingatiwa. |
.info |
Inatumika kama mbadala kwa mitindo chaguo-msingi. |
# | Bidhaa | Malipo Yamechukuliwa | Hali |
---|---|---|---|
1 | TB - Kila mwezi | 01/04/2012 | Imeidhinishwa |
2 | TB - Kila mwezi | 02/04/2012 | Imekataliwa |
3 | TB - Kila mwezi | 03/04/2012 | Inasubiri |
4 | TB - Kila mwezi | 04/04/2012 | Piga simu ili kuthibitisha |
- ...
- < tr class = "success" >
- <td> 1 < /td>
- <td>TB - Kila Mwezi</ td >
- <td> 01 / 04 / 2012 < /td>
- <td>Imeidhinishwa</ td >
- </ tr >
- ...
Orodha ya vipengele vya HTML vya jedwali vinavyotumika na jinsi vinapaswa kutumiwa.
Lebo | Maelezo |
---|---|
<table> |
Kipengele cha kufunga kwa ajili ya kuonyesha data katika umbizo la jedwali |
<thead> |
Kipengele cha chombo cha safu mlalo za vichwa vya jedwali ( <tr> ) kuweka lebo kwenye safu wima za jedwali |
<tbody> |
Kipengele cha chombo cha safu za jedwali ( <tr> ) kwenye mwili wa jedwali |
<tr> |
Kipengele cha chombo cha seti ya seli za jedwali ( <td> au <th> ) zinazoonekana kwenye safu mlalo moja |
<td> |
Seli chaguomsingi ya jedwali |
<th> |
Seli maalum ya jedwali kwa safu wima (au safu mlalo, kulingana na upeo na uwekaji) lebo |
<caption> |
Maelezo au muhtasari wa kile ambacho jedwali inashikilia, muhimu sana kwa visoma skrini |
- <meza>
- <caption> ... </caption>
- <kichwa>
- <tr>
- <th> ... </th>
- <th> ... </th>
- </ tr>
- </ kichwa>
- <tbody>
- <tr>
- <td> ... </td>
- <td> ... </td>
- </ tr>
- </tbody>
- </ meza>
Vidhibiti vya aina ya mtu binafsi hupokea mitindo, lakini bila darasa la msingi linalohitajika kwenye <form>
au mabadiliko makubwa katika tabo. Matokeo katika lebo zilizopangwa kwa rafu, zilizopangiliwa kushoto juu ya vidhibiti vya fomu.
- <fomu>
- <seti ya uwanja>
- <legend> Legend </legend>
- <label> Jina la lebo </label>
- <input type = "text" placeholder = "Andika kitu..." >
- <span class = "help-block" > Mfano wa maandishi ya usaidizi wa kiwango cha kuzuia hapa. </span>
- <label class = "checkbox" >
- <input type = "checkbox" > Niangalie
- </lebo>
- <button type = "submit" class = "btn" > Wasilisha </button>
- </fieldset>
- </ fomu>
Iliyojumuishwa na Bootstrap ni miundo mitatu ya hiari ya fomu kwa kesi za matumizi ya kawaida.
Ongeza .form-search
kwenye fomu na .search-query
kwa <input>
ingizo la maandishi ya ziada.
- <form class = "form-search" >
- <input type = "text" class = "input-medium search-query" >
- <button type = "submit" class = "btn" > Tafuta </button>
- </ fomu>
Ongeza .form-inline
kwa lebo zilizopangiliwa kushoto na vidhibiti vya uzuiaji wa ndani kwa mpangilio shikamanifu.
- <form class = "form-inline" >
- <input type = "text" class = "input-small" placeholder = "Email" >
- <input type = "password" class = "input-small" placeholder = "Nenosiri" >
- <label class = "checkbox" >
- <input type = "checkbox" > Nikumbuke
- </lebo>
- <button type = "submit" class = "btn" > Ingia </button>
- </ fomu>
Pangilia lebo kulia na uzielee upande wa kushoto ili kuzifanya zionekane kwenye mstari sawa na vidhibiti. Inahitaji mabadiliko mengi zaidi kutoka kwa fomu chaguo-msingi:
.form-horizontal
kwenye fomu.control-group
.control-label
kwenye lebo.controls
kwa upangaji sahihi
- <form class = "form-horizontal" >
- <div class = "control-group" >
- <label class = "control-label" for = "inputEmail" > Barua pepe </label>
- <div class = "vidhibiti" >
- <input type = "text" id = "inputEmail" placeholder = "Barua pepe" >
- </ div>
- </ div>
- <div class = "control-group" >
- <label class = "control-label" kwa = "inputPassword" > Nenosiri </label>
- <div class = "vidhibiti" >
- <input type = "password" id = "inputPassword" placeholder = "Nenosiri" >
- </ div>
- </ div>
- <div class = "control-group" >
- <div class = "vidhibiti" >
- <label class = "checkbox" >
- <input type = "checkbox" > Nikumbuke
- </lebo>
- <button type = "submit" class = "btn" > Ingia </button>
- </ div>
- </ div>
- </ fomu>
Mifano ya vidhibiti vya kawaida vya fomu vinavyotumika katika muundo wa muundo wa mfano.
Udhibiti wa kawaida wa fomu, uga zinazotegemea maandishi. Inajumuisha usaidizi wa aina zote za HTML5: maandishi, nenosiri, saa, tarehe-ndani, tarehe, mwezi, saa, wiki, nambari, barua pepe, url, utafutaji, simu na rangi.
Inahitaji matumizi ya maalum type
wakati wote.
- <input type = "text" placeholder = "Ingizo la maandishi" >
Udhibiti wa fomu ambao unaauni mistari mingi ya maandishi. Badilisha rows
sifa inapohitajika.
- <textarea rows = "3" ></textarea>
Vikasha tiki ni vya kuchagua chaguo moja au kadhaa katika orodha huku redio ni za kuchagua chaguo moja kutoka nyingi.
- <label class = "checkbox" >
- <input type = "checkbox" value = "" >
- Chaguo la kwanza ni hili na lile—hakikisha umejumuisha kwa nini ni nzuri
- </lebo>
- <label class = "radio" >
- <input type = "radio" name = "optionsRadios" id = "optionsRadios1" value = "option1" imechaguliwa >
- Chaguo la kwanza ni hili na lile—hakikisha umejumuisha kwa nini ni nzuri
- </lebo>
- <label class = "radio" >
- <input type = "radio" name = "optionsRadios" id = "optionsRadios2" value = "option2" >
- Chaguo la pili linaweza kuwa jambo lingine na kulichagua kutaondoa chaguo la kwanza
- </lebo>
Ongeza .inline
darasa kwenye mfululizo wa visanduku vya kuteua au redio kwa ajili ya vidhibiti kuonekana kwenye mstari mmoja.
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox1" value = "option1" > 1
- </lebo>
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox2" value = "option2" > 2
- </lebo>
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox3" value = "option3" > 3
- </lebo>
Tumia chaguo-msingi au bainisha a multiple="multiple"
ili kuonyesha chaguo nyingi kwa wakati mmoja.
- <chagua>
- <chaguo> 1 </option>
- <chaguo> 2 </option>
- <chaguo> 3 </option>
- <chaguo> 4 </option>
- <chaguo> 5 </option>
- </ chagua>
- <chagua nyingi = "multiple" >
- <chaguo> 1 </option>
- <chaguo> 2 </option>
- <chaguo> 3 </option>
- <chaguo> 4 </option>
- <chaguo> 5 </option>
- </ chagua>
Kuongeza juu ya vidhibiti vilivyopo vya kivinjari, Bootstrap inajumuisha vipengele vingine muhimu vya fomu.
Ongeza maandishi au vitufe kabla au baada ya ingizo lolote linalotegemea maandishi. Kumbuka kuwa select
vipengele havitumiki hapa.
Funga .add-on
na input
moja ya madarasa mawili ili kutanguliza au kuambatanisha maandishi kwa ingizo.
- <div class = "input-prepend" >
- <span class = "add-on" > @ </span>
- <input class = "span2" id = "prependedInput" type = "text" kishika nafasi = "Jina la mtumiaji" >
- </ div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedInput" type = "text" >
- <span class = "add-on" > .00 </span>
- </ div>
Tumia aina zote mbili na mifano miwili ya .add-on
kutayarisha na kuongezea ingizo.
- <div class = "input-prepend input-append" >
- <span class = "add-on" > $ </span>
- <input class = "span2" id = "appendedPrependedInput" type = "text" >
- <span class = "add-on" > .00 </span>
- </ div>
Badala ya a <span>
na maandishi, tumia a .btn
kuambatisha kitufe (au mbili) kwa ingizo.
- <div class = "input-append" >
- <input class = "span2" id = "appendedInputButton" type = "text" >
- <button class = "btn" type = "button" > Nenda! </kifungo>
- </ div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedInputButtons" type = "text" >
- <button class = "btn" type = "button" > Tafuta </button>
- <button class = "btn" type = "button" > Chaguo </button>
- </ div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedDropdownButton" type = "text" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Kitendo
- <span class = "caret" ></span>
- </kifungo>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </ div>
- </ div>
- <div class = "input-prepend" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Kitendo
- <span class = "caret" ></span>
- </kifungo>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </ div>
- <input class = "span2" id = "prependedDropdownButton" type = "text" >
- </ div>
- <div class = "input-prepend input-append" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Kitendo
- <span class = "caret" ></span>
- </kifungo>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </ div>
- <input class = "span2" id = "appendedPrependedDropdownButton" type = "text" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Kitendo
- <span class = "caret" ></span>
- </kifungo>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </ div>
- </ div>
- <fomu>
- <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>
- </ fomu>
- <form class = "form-search" >
- <div class = "input-append" >
- <input type = "text" class = "span2 search-query" >
- <button type = "submit" class = "btn" > Tafuta </button>
- </ div>
- <div class = "input-prepend" >
- <button type = "submit" class = "btn" > Tafuta </button>
- <input type = "text" class = "span2 search-query" >
- </ div>
- </ fomu>
Tumia madarasa ya ukubwa wa jamaa kama .input-large
au kulinganisha ingizo lako na saizi za safu wima ya gridi ukitumia.span*
madarasa.
Fanya kitu chochote <input>
au <textarea>
kipengee kiwe kama kipengele cha kiwango cha kuzuia.
- <input class = "input-block-level" type = "text" placeholder = ".input-block-level" >
- <input class = "input-mini" type = "text" placeholder = ".input-mini" >
- <input class = "input-small" type = "text" placeholder = ".input-small" >
- <input class = "input-medium" type = "text" placeholder = ".input-medium" >
- <input class = "input-large" type = "text" placeholder = ".input-large" >
- <input class = "input-xlarge" type = "text" placeholder = ".input-xlarge" >
- <input class = "input-xxlarge" type = "text" placeholder = ".input-xxlarge" >
Vichwa juu!Katika matoleo yajayo, tutakuwa tukibadilisha matumizi ya madarasa haya ya kuingiza data kulingana na ukubwa wa vitufe vyetu. Kwa mfano, .input-large
itaongeza pedi na saizi ya fonti ya ingizo.
Tumia .span1
kwa .span12
ingizo zinazolingana na ukubwa sawa wa safu wima za gridi ya taifa.
- <input class = "span1" type = "text" kishika nafasi = ".span1" >
- <input class = "span2" type = "text" kishika nafasi = ".span2" >
- <input class = "span3" type = "text" kishika nafasi = ".span3" >
- <select class = "span1" >
- ...
- </ chagua>
- <select class = "span2" >
- ...
- </ chagua>
- <select class = "span3" >
- ...
- </ chagua>
Kwa pembejeo nyingi za gridi kwa kila mstari, tumia .controls-row
darasa la kurekebisha kwa nafasi sahihi . Huelea pembejeo ili kukunja nafasi-nyeupe, huweka pambizo zinazofaa, na kusafisha kuelea.
- <div class = "vidhibiti" >
- <input class = "span5" type = "text" kishika nafasi = ".span5" >
- </ div>
- <div class = "controls-rows-row" >
- <input class = "span4" type = "text" kishika nafasi = ".span4" >
- <input class = "span1" type = "text" kishika nafasi = ".span1" >
- </ div>
- ...
Wasilisha data katika fomu ambayo haiwezi kuhaririwa bila kutumia fomula halisi.
- <span class = "input-xlarge input-input" > Thamani fulani hapa </span>
Maliza fomu na kikundi cha vitendo (vifungo). Inapowekwa ndani ya .form-actions
, vitufe vitajipinda kiotomatiki ili kupatana na vidhibiti vya fomu.
- <div class = "form-actions" >
- <button type = "submit" class = "btn btn-primary" > Hifadhi mabadiliko </button>
- <button type = "button" class = "btn" > Ghairi </button>
- </ div>
Usaidizi wa kiwango cha ndani na cha kuzuia kwa maandishi ya usaidizi yanayoonekana karibu na vidhibiti vya fomu.
- <input type = "text" ><span class = "help-inline" > Maandishi ya usaidizi ya ndani </span>
- <input type = "text" ><span class = "help-block" > Kizuizi kirefu cha matini ya usaidizi ambayo huingia kwenye mstari mpya na huenda ikavuka mstari mmoja. </span>
Toa maoni kwa watumiaji au wageni na hali za msingi za maoni kuhusu vidhibiti vya fomu na lebo.
Tunaondoa outline
mitindo chaguo-msingi kwenye baadhi ya vidhibiti vya fomu na kuweka a box-shadow
badala yake kwa :focus
.
- <input class = "input-xlarge" id = "focusedInput" type = "text" value = "Hii imelenga..." >
Ingizo za mtindo kupitia utendakazi chaguomsingi wa kivinjari na :invalid
. Bainisha type
, ongeza required
sifa ikiwa uga si wa hiari, na (ikiwa inatumika) bainisha pattern
.
Hii haipatikani katika matoleo ya Internet Explorer 7-9 kwa sababu ya ukosefu wa usaidizi kwa viteuzi bandia vya CSS.
- <input class = "span3" type = "email" inahitajika >
Ongeza disabled
sifa kwenye ingizo ili kuzuia ingizo la mtumiaji na uanzishe mwonekano tofauti kidogo.
- <input class = "input-xlarge" id = "disabledInput" type = "text" kishika nafasi = "Ingizo limezimwa hapa..." imezimwa >
Bootstrap inajumuisha mitindo ya uthibitishaji kwa hitilafu, onyo, maelezo na ujumbe wa mafanikio. Ili kutumia, ongeza darasa linalofaa kwa jirani .control-group
.
- <div class = "control-group onyo" >
- <label class = "control-label" for = "inputWarning" > Ingizo lenye onyo </label>
- <div class = "vidhibiti" >
- <input type = "text" id = "inputWarning" >
- <span class = "help-inline" > Huenda kitu kimeenda vibaya </span>
- </ div>
- </ div>
- <div class = "control-group error" >
- <label class = "control-label" for = "inputError" > Ingizo lenye hitilafu </label>
- <div class = "vidhibiti" >
- <input type = "text" id = "inputError" >
- <span class = "help-inline" > Tafadhali sahihisha hitilafu </span>
- </ div>
- </ div>
- <div class = "control-group info" >
- <label class = "control-label" for = "inputInfo" > Ingizo lenye maelezo </label>
- <div class = "vidhibiti" >
- <input type = "text" id = "inputInfo" >
- <span class = "help-inline" > Jina la mtumiaji tayari limechukuliwa </span>
- </ div>
- </ div>
- <div class = "control-group success" >
- <label class = "control-label" for = "inputSuccess" > Ingizo limefanikiwa </label>
- <div class = "vidhibiti" >
- <input type = "text" id = "inputSuccess" >
- <span class = "help-inline" > Woohoo! </span>
- </ div>
- </ div>
Ongeza madarasa kwenye <img>
kipengele ili uunde kwa urahisi picha katika mradi wowote.
- <img src = "..." class = "img-rounded" >
- <img src = "..." class = "img-circle" >
- <img src = "..." class = "img-polaroid" >
Vichwa juu! .img-rounded
na .img-circle
usifanye kazi katika IE7-8 kwa sababu ya ukosefu wa border-radius
msaada.
Ikoni 140 katika umbo la sprite, zinapatikana katika kijivu giza (chaguo-msingi) na nyeupe, zinazotolewa na Glyphicons .
Glyphicons Halflings kwa kawaida haipatikani bila malipo, lakini mpangilio kati ya Bootstrap na waundaji wa Glyphicons umewezesha hili bila gharama yoyote kwako kama wasanidi. Kama shukrani, tunakuomba ujumuishe kiungo cha hiari cha kurudi kwenye Glyphicons wakati wowote inapowezekana.
Aikoni zote zinahitaji <i>
lebo iliyo na darasa la kipekee, iliyoangaziwa na icon-
. Ili kutumia, weka nambari ifuatayo karibu popote:
- <i class = "icon-search" ></i>
Pia kuna mitindo inayopatikana kwa ikoni zilizogeuzwa (nyeupe), zilizotengenezwa tayari na darasa moja la ziada. Tutatekeleza darasa hili la kuelea na hali amilifu kwa viungo vya nav na kunjuzi.
- <i class = "ikoni-ya utafutaji ikoni-nyeupe" ></i>
Vichwa juu!Unapotumia kando ya mifuatano ya maandishi, kama vile vitufe au viungo vya nav, hakikisha kuwa umeacha nafasi baada ya <i>
lebo kwa nafasi ifaayo.
Zitumie katika vitufe, vikundi vya vitufe kwa upau wa vidhibiti, usogezaji, au ingizo za fomu zilizotangulizwa.
- <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> Mtumiaji </a>
- <a class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" href = "#" ><span class = "caret" ></span></a>
- <ul class = "dropdown-menu" >
- <li><a href = "#" ><i class = "icon-penseli" ></i> Hariri </a></li>
- <li><a href = "#" ><i class = "ikoni-takataka" ></i> Futa </a></li>
- <li><a href = "#" ><i class = "icon-ban-circle" ></i> Piga marufuku </a></li>
- <li class = "divider" ></li>
- <li><a href = "#" ><i class = "i" ></i> Weka msimamizi </a></li>
- </ul>
- </ div>
- <a class = "btn btn-large" href = "#" ><i class = "icon-star" ></i> Star </a>
- <a class = "btn btn-small" href = "#" ><i class = "icon-star" ></i> Star </a>
- <a class = "btn btn-mini" href = "#" ><i class = "icon-star" ></i> Star </a>
- <ul class = "nav nav-list" >
- <li class = "active" ><a href = "#" ><i class = "icon-home icon-white" ></i> Nyumbani </a></li>
- <li><a href = "#" ><i class = "ikoni-kitabu" ></i> Maktaba </a></li>
- <li><a href = "#" ><i class = "icon-penseli" ></i> Maombi </a></li>
- <li><a href = "#" ><i class = "i" ></i> Misc </a></li>
- </ul>
- <div class = "control-group" >
- <label class = "control-label" for = "inputIcon" > Anwani ya barua pepe </label>
- <div class = "vidhibiti" >
- <div class = "input-prepend" >
- <span class = "add-on" ><i class = "ikoni-bahasha" ></i></span>
- <input class = "span2" id = "inputIcon" type = "text" >
- </ div>
- </ div>
- </ div>