Cov ntsiab lus HTML tseem ceeb tau tsim thiab txhim kho nrog cov chav kawm txuas ntxiv.
Tag nrho cov ntsiab lus HTML, <h1>
dhau los <h6>
muaj.
Bootstrap lub ntiaj teb no default font-size
yog 14px , nrog ib tug line-height
ntawm 20px . Qhov no yog siv rau <body>
tag nrho cov kab lus. Tsis tas li ntawd, <p>
(cov kab lus) tau txais cov kab hauv qab ntawm ib nrab ntawm lawv cov kab-qhov siab (10px los ntawm lub neej ntawd).
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 zaum amet tsis 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>
Ua ib kab lus sawv tawm los ntawm kev ntxiv .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, nws tsis yog commodo luctus.
<p class = "lead" > ... </p>
Qhov ntsuas typographic yog nyob ntawm ob qhov sib txawv LESS hauv variables.less : @baseFontSize
thiab @baseLineHeight
. Thawj yog lub hauv paus font-loj siv thoob plaws thiab qhov thib ob yog lub hauv paus kab-qhov siab. Peb siv cov kev hloov pauv no thiab qee qhov lej yooj yim los tsim cov npoo, paddings, thiab kab-qhov siab ntawm txhua yam peb hom thiab ntau dua. Customize lawv thiab Bootstrap adapts.
Ua kom siv HTML's default emphasis tags nrog cov qauv hnyav.
<small>
Txhawm rau tshem tawm qhov tseem ceeb hauv kab lossis thaiv cov ntawv, siv lub cim me me.
Cov kab ntawv no yog txhais tau tias yuav tsum tau kho raws li kev luam zoo.
<p> <small> Cov kab ntawv no txhais tau hais tias yuav tsum tau kho kom zoo zoo. </small> </p>
Rau kev hais txog ib qho snippet ntawm cov ntawv nrog hnyav font-qhov hnyav.
Cov snippet hauv qab no yog rendered ua bold text .
<strong> rendered as bold text </strong>
Rau kev hais txog ib ntu ntawm cov ntawv nrog italics.
Cov kab lus hauv qab no tau muab ua cov ntawv italicized .
<em> ua li ntawv italicized </em>
Tau taub hau!Txaus siab rau siv <b>
thiab <i>
hauv HTML5. <b>
yog txhais tau hais tias tseem ceeb cov lus lossis kab lus yam tsis muaj qhov tseem ceeb ntxiv thaum <i>
feem ntau yog rau lub suab, cov lus qhia, thiab lwm yam.
Yooj yim realign cov ntawv rau cov khoom nrog cov chav kawm ntawv nyeem.
Left aligned text.
Center aligned ntawv nyeem.
Txoj cai dlhos ntawv.
- <p class = "text-left" > Left aligned text. </p>
- <p class = "text-center" > Nruab nrab cov ntawv nyeem. </p>
- <p class = "text-right" > Cov ntawv nyeem txoj cai. </p>
Qhia lub ntsiab lus los ntawm cov xim nrog ib txhais tes ntawm cov chav kawm siv hluav taws xob.
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, tsis yog commodo luctus, nisi erat porttitor ligula.
- <p class = "muted" > Fusce dapibus, tellus ac cursus commodo, tortor 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>
Stylized kev siv ntawm HTML lub <abbr>
ntsiab lus rau cov ntawv luv thiab cov lus sau los qhia qhov nthuav dav ntawm hover. Cov ntawv luv luv nrog tus title
cwj pwm muaj lub teeb dotted hauv qab ciam teb thiab tus cursor pab ntawm hover, muab cov ntsiab lus ntxiv ntawm hover.
<abbr>
Rau cov ntawv nthuav dav ntawm qhov ntev hover ntawm cov ntawv luv, suav nrog tus title
cwj pwm.
Lub ntsiab lus ntawm lo lus attribute yog attr .
<abbr title = "attribute" > attr </abbr>
<abbr class="initialism">
Ntxiv .initialism
rau cov ntawv luv rau me me font-loj.
HTML yog qhov zoo tshaj plaws txij li lub khob cij hlais.
<abbr title = "HyperText Markup Language" class = "initialism" > HTML </abbr>
Muab cov ntaub ntawv tiv tauj tam sim no rau cov poj koob yawm txwv ze tshaj plaws lossis tag nrho lub cev ua haujlwm.
<address>
Khaws formatting los ntawm kev xaus tag nrho cov kab nrog <br>
.
- <chaw nyob>
- <strong> Twitter, Inc. </strong><br>
- 795 Folsom Ave, Suite 600
- San Francisco, CA 94107 <br>
- <abbr title = "Phone" > P: </abbr> (123) 456-7890
- </ address>
- <chaw nyob>
- <strong> Npe tag nrho </strong><br>
- <a href = "mailto:#" > [email protected] </a>
- </ address>
Rau quoting blocks ntawm cov ntsiab lus los ntawm lwm qhov chaw hauv koj cov ntaub ntawv.
Qhwv <blockquote>
ib ncig ntawm HTML raws li cov lus tsocai. Rau cov quotes ncaj peb pom zoo a <p>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante. </p>
- </blockquote>
Style thiab cov ntsiab lus hloov pauv rau cov kev hloov pauv yooj yim ntawm tus qauv blockquote.
Ntxiv <small>
tag rau kev txheeb xyuas qhov chaw. Muab lub npe ntawm qhov chaw ua haujlwm hauv <cite>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante.
Ib tug neeg nto moo nyob rau hauv Lub Npe Lub Npe
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante. </p>
- <small> Ib tug neeg nto moo <cite title = "Source Title" > Source Title </cite></small>
- </blockquote>
Siv .pull-right
rau qhov floated, right-aligned blockquote.
- <blockquote class = "rub-right" >
- ...
- </blockquote>
Ib daim ntawv teev cov khoom uas qhov kev txiav txim tsis meej meej.
- <ul>
- <li> ... </li>
- </ul>
Ib daim ntawv teev cov khoom uas qhov kev txiav txim tsis meej.
- <ol>
- <li> ... </li>
- </ol>
Tshem tawm lub neej ntawd list-style
thiab sab laug padding ntawm cov npe khoom (cov me nyuam tam sim ntawd xwb).
- <ul class = "unstyled" >
- <li> ... </li>
- </ul>
Muab tag nrho cov npe khoom rau ntawm ib kab nrog inline-block
thiab qee lub teeb padding.
- <ul class = "inline" >
- <li> ... </li>
- </ul>
Ib daim ntawv teev cov ntsiab lus nrog lawv cov lus piav qhia.
- <dl>
- <dt> ... </dt>
- <dd> ... </dd>
- </dl>
Ua cov ntsiab lus thiab cov lus piav qhia nyob rau hauv <dl>
kab ntawm ib sab.
- <dl class = "dl-horizontal" >
- <dt> ... </dt>
- <dd> ... </dd>
- </dl>
Tau taub hau!Kab rov tav cov npe piav qhia yuav txiav cov ntsiab lus uas ntev dhau los ua kom haum rau sab laug kho text-overflow
. Nyob rau hauv nqaim viewports, lawv yuav hloov mus rau lub default stacked layout.
Qhwv inline snippet ntawm code nrog <code>
.
<section>
yuav tsum tau qhwv li inline.
- Piv txwv li , <code> & lt ; seem & gt ;</ code > yuav tsum tau qhwv li inline .
Siv <pre>
rau ntau kab ntawm cov cai. Nco ntsoov khiav txhua lub kaum sab xis hauv cov cai rau kev ua kom raug.
<p>Simple text here...</p>
- <pre>
- <p>Sample text here...</p>
- </pre>
Tau taub hau!Nco ntsoov khaws cov cai hauv <pre>
cov cim npe ze rau sab laug li sai tau; nws yuav muab tag nrho cov tabs.
Koj tuaj yeem xaiv ntxiv cov .pre-scrollable
chav kawm uas yuav teeb tsa max-qhov siab ntawm 350px thiab muab y-axis scrollbar.
Rau qhov yooj yim styling - lub teeb padding thiab tsuas yog kab rov tav dividers - ntxiv cov hauv paus chav kawm .table
rau ib qho twg <table>
.
# | Lub Npe | Lub Npe | Tus neeg siv lub npe |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Yakhauj | Thornton | @fat |
3 | Larry | noog |
- <table class = "tab" >
- …
- </table>
Ntxiv ib qho ntawm cov chav kawm hauv qab no rau .table
hauv chav kawm hauv paus.
.table-striped
Ntxiv zebra-striping rau ib kab kab hauv kab <tbody>
ntawm :nth-child
CSS selector (tsis muaj nyob hauv IE7-8).
# | Lub Npe | Lub Npe | Tus neeg siv lub npe |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Yakhauj | Thornton | @fat |
3 | Larry | noog |
- <table class = "table table-striped" >
- …
- </table>
.table-bordered
Ntxiv ciam teb thiab cov ces kaum sib npaug rau lub rooj.
# | Lub Npe | Lub Npe | Tus neeg siv lub npe |
---|---|---|---|
1 | Mark | Otto | @mdo |
Mark | Otto | @getbootstrap | |
2 | Yakhauj | Thornton | @fat |
3 | Larry noog |
- <table class = "table table-bordered" >
- …
- </table>
.table-hover
Ua kom lub xeev hover ntawm cov kab lus hauv ib <tbody>
.
# | Lub Npe | Lub Npe | Tus neeg siv lub npe |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Yakhauj | Thornton | @fat |
3 | Larry noog |
- <table class = "table table-hover" >
- …
- </table>
.table-condensed
Ua cov ntxhuav ntau dua los ntawm kev txiav cell padding hauv ib nrab.
# | Lub Npe | Lub Npe | Tus neeg siv lub npe |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Yakhauj | Thornton | @fat |
3 | Larry noog |
- <table class = "table table-condensed" >
- …
- </table>
Siv cov chav kawm contextual rau xim kab kab.
Chav kawm | Kev piav qhia |
---|---|
.success |
Qhia tau tias muaj kev vam meej lossis zoo. |
.error |
Qhia txog qhov txaus ntshai lossis qhov ua tsis zoo. |
.warning |
Qhia ceeb toom uas yuav xav tau kev saib xyuas. |
.info |
Siv raws li ib qho kev xaiv rau lub neej ntawd styles. |
# | Khoom | Them Nyiaj | xwm txheej |
---|---|---|---|
1 | TB - Txhua hli | 01/04/2012 | Pom zoo |
2 | TB - Txhua hli | 02/04/2012 | Tsis kam |
3 | TB - Txhua hli | 03/04/2012 | Tseem tos |
4 | TB - Txhua hli | 04/04/2012 | Hu rau hauv kom paub meej |
- ...
- < tr class = "success" >
- <td> 1 < /td>
- <td>TB - Txhua hli</ td >
- < td > 01/04/2012 < / td >
- <td>pom</ td >
- </ tr >
- ...
Cov npe ntawm cov lus txhawb HTML ntsiab lus thiab lawv yuav tsum siv li cas.
Tag | Kev piav qhia |
---|---|
<table> |
Wrapping keeb los tso saib cov ntaub ntawv hauv hom ntawv tabular |
<thead> |
Cov khoom ntim rau lub rooj header kab ( <tr> ) rau daim ntawv lo rau kab lus |
<tbody> |
Thawv khoom rau kab kab ( <tr> ) nyob rau hauv lub cev ntawm lub rooj |
<tr> |
Thawv khoom rau ib pawg ntawm cov kab lus ( <td> lossis <th> ) uas tshwm ntawm ib kab |
<td> |
Default rooj cell |
<th> |
Cov lus tshwj xeeb ntawm tes rau kem (los yog kab, nyob ntawm seb qhov twg thiab qhov chaw) cov ntawv |
<caption> |
Cov lus piav qhia lossis cov ntsiab lus ntawm cov lus tuav, tshwj xeeb tshaj yog muaj txiaj ntsig zoo rau cov neeg nyeem ntawv |
- <tab>
- <caption> ... </caption>
- <thead>
- <tr>
- <th> ... </th>
- <th> ... </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td> ... </td>
- <td> ... </td>
- </tr>
- </tbody>
- </table>
Cov kev tswj ntawm tus kheej tau txais styling, tab sis tsis tas yuav tsum muaj cov chav kawm hauv paus ntawm <form>
lossis kev hloov pauv loj hauv kev kos. Qhov tshwm sim nyob rau hauv stacked, sab laug-aligned daim ntawv nyob rau sab saum toj ntawm daim ntawv tswj.
- <form>
- <fieldset>
- <Legend> Lus dab neeg </legend>
- <label> Label name </label>
- <input type = "text" placeholder = "Type something..." >
- <span class = "help-block" > Piv txwv block-level help text here. </span>
- <label class = "checkbox" >
- <input type = "checkbox" > Kos kuv tawm
- </label>
- <button type = "submit" class = "btn" > Xa </button>
- </fieldset>
- </form>
Xws li nrog Bootstrap yog peb txoj hauv kev xaiv daim ntawv layouts rau cov neeg siv ntau.
Ntxiv .form-search
rau daim ntawv thiab .search-query
mus rau qhov kev nkag <input>
mus rau cov ntawv nyeem ntxiv.
- <form class = "form-search" >
- <input type = "text" class = "input-medium search-query" >
- <button type = "submit" class = "btn" > Nrhiav </button>
- </form>
Ntxiv .form-inline
rau cov ntawv sau sab laug thiab inline-block tswj rau kev sib cog lus.
- <form class = "form-inline" >
- <input type = "text" class = "input-small" placeholder = "Email" >
- <input type = "password" class = "input-small" placeholder = "password" >
- <label class = "checkbox" >
- <input type = "checkbox" > Nco kuv
- </label>
- <button type = "submit" class = "btn" > Kos npe rau hauv </button>
- </form>
Txoj cai dlhos cov ntawv thiab ntab lawv mus rau sab laug kom lawv tshwm ntawm tib kab li kev tswj hwm. Yuav tsum muaj kev hloov pauv feem ntau los ntawm daim ntawv ua ntej:
.form-horizontal
rau daim ntawv.control-group
.control-label
rau daim ntawv lo.controls
kev sib raug zoo
- <form class = "form-horizontal" >
- <div class = "control-group" >
- <label class = "control-label" for = "inputEmail" > Email </label>
- <div class = "controls" >
- <input type = "text" id = "inputEmail" placeholder = "Email" >
- </div>
- </div>
- <div class = "control-group" >
- <label class = "control-label" rau = "inputPassword" > Password </label>
- <div class = "controls" >
- <input type = "password" id = "inputPassword" placeholder = "Password" >
- </div>
- </div>
- <div class = "control-group" >
- <div class = "controls" >
- <label class = "checkbox" >
- <input type = "checkbox" > Nco kuv
- </label>
- <button type = "submit" class = "btn" > Kos npe rau hauv </button>
- </div>
- </div>
- </form>
Piv txwv ntawm cov qauv kev tswj hwm kev txhawb nqa hauv ib qho piv txwv daim ntawv layout.
Feem ntau hom kev tswj, cov ntawv nyeem-raws li kev nkag teb chaws. Xws li kev txhawb nqa rau txhua hom HTML5: ntawv nyeem, lo lus zais, hnub tim, hnub tim-hauv zos, hnub tim, hli, sijhawm, lub limtiam, tus lej, email, url, tshawb nrhiav, xov tooj, thiab xim.
Yuav tsum tau siv cov lus teev tseg type
txhua lub sijhawm.
- <input type = "text" placeholder = "Text input" >
Daim ntawv tswj uas txhawb nqa ntau cov kab ntawv. Hloov rows
tus cwj pwm raws li qhov tsim nyog.
- <textarea rows = "3" ></textarea>
Checkboxes yog xaiv ib lossis ntau txoj hauv kev hauv ib daim ntawv teev npe thaum lub xov tooj cua yog xaiv ib qho kev xaiv los ntawm ntau.
- <label class = "checkbox" >
- <input type = "checkbox" tus nqi = "" >
- Kev xaiv ib qho yog qhov no thiab qhov ntawd - nco ntsoov suav nrog vim li cas nws zoo heev
- </label>
- <label class = "radio" >
- <input type = "radio" name = "optionsRadios" id = "optionsRadios1" tus nqi = "option1" kos >
- Kev xaiv ib qho yog qhov no thiab qhov ntawd - nco ntsoov suav nrog vim li cas nws zoo heev
- </label>
- <label class = "radio" >
- <input type = "radio" name = "optionsRadios" id = "optionsRadios2" tus nqi = "option2" >
- Kev xaiv ob tuaj yeem yog lwm yam thiab xaiv nws yuav tsis xaiv qhov kev xaiv ib qho
- </label>
Ntxiv cov .inline
chav kawm rau ib lub thawv kos lossis xov tooj cua rau kev tswj hwm tshwm sim ntawm tib kab.
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox1" tus nqi = "option1" > 1
- </label>
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox2" tus nqi = "option2" > 2
- </label>
- <label class = "checkbox inline" >
- <input type = "checkbox" id = "inlineCheckbox3" tus nqi = "option3" > 3
- </label>
Siv lub neej ntawd xaiv los yog qhia ib tug multiple="multiple"
los qhia ntau yam kev xaiv ib zaug.
- <xaiv>
- <option> 1 </option>
- <option> 2 </option>
- <option> 3 </option>
- <option> 4 </option>
- <option> 5 </option>
- </select>
- <xaiv ntau = "ntau yam" >
- <option> 1 </option>
- <option> 2 </option>
- <option> 3 </option>
- <option> 4 </option>
- <option> 5 </option>
- </select>
Ntxiv rau sab saum toj ntawm qhov browser uas twb muaj lawm, Bootstrap suav nrog lwm cov ntaub ntawv tseem ceeb.
Ntxiv cov ntawv los yog cov nyees khawm ua ntej lossis tom qab cov ntawv nyeem raws li kev nkag. Nco ntsoov tias select
cov ntsiab lus tsis txhawb nqa ntawm no.
Qhwv ib qho .add-on
thiab ib qho input
nrog ib qho ntawm ob chav kawm los ua ntej lossis ntxiv cov ntawv rau kev nkag.
- <div class = "input-prepend" >
- <span class = "add-on" > @ </span>
- <input class = "span2" id = "prependedInput" type = "text" placeholder = "Username" >
- </div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedInput" type = "text" >
- <span class = "add-on" > .00 </span>
- </div>
Siv ob chav kawm thiab ob qho piv txwv ntawm .add-on
los ua ntej thiab ntxiv ib qho kev tawm tswv yim.
- <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>
Hloov cov ntawv <span>
nrog cov ntawv, siv .btn
lub khawm (lossis ob) rau kev nkag.
- <div class = "input-append" >
- <input class = "span2" id = "appendedInputButton" type = "text" >
- <button class = "btn" type = "button" > Mus! </button>
- </div>
- <div class = "input-append" >
- <input class = "span2" id = "appendedInputButtons" type = "text" >
- <button class = "btn" type = "button" > Nrhiav </button>
- <button class = "btn" type = "button" > Xaiv </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" >
- Kev ua
- <span dir = "ltr" >Tswv Yim Vaj</span>
- </button>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </div>
- </div>
- <div class = "input-prepend" >
- <div class = "btn-group" >
- <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
- Kev ua
- <span dir = "ltr" >Tswv Yim Vaj</span>
- </button>
- <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" >
- Kev ua
- <span dir = "ltr" >Tswv Yim Vaj</span>
- </button>
- <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" >
- Kev ua
- <span dir = "ltr" >Tswv Yim Vaj</span>
- </button>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </div>
- </div>
- <form>
- <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>
- </form>
- <form class = "form-search" >
- <div class = "input-append" >
- <input type = "text" class = "span2 search-query" >
- <button type = "submit" class = "btn" > Nrhiav </button>
- </div>
- <div class = "input-prepend" >
- <button type = "submit" class = "btn" > Nrhiav </button>
- <input type = "text" class = "span2 search-query" >
- </div>
- </form>
Siv cov chav kawm txheeb ze sib txawv xws li .input-large
lossis phim koj cov khoom siv rau cov kab sib chaws kab uas siv .span*
cov chav kawm.
Ua ib qho <input>
los yog <textarea>
lub hauv paus coj zoo li qhov thaiv qib theem.
- <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" >
Tau taub hau!Nyob rau hauv lub neej yav tom ntej versions, peb yuav tau hloov kho kev siv ntawm cov txheeb ze input chav kawm kom phim peb cov pob loj. Piv txwv li, .input-large
yuav ua rau kom cov padding thiab font-loj ntawm cov tswv yim.
Siv .span1
rau .span12
cov khoom siv uas sib xws tib qhov ntau thiab tsawg ntawm kab kab sib chaws.
- <input class = "span1" type = "text" placeholder = ".span1" >
- <input class = "span2" type = "text" placeholder = ".span2" >
- <input class = "span3" type = "text" placeholder = ".span3" >
- <select class = "span1" >
- ...
- </select>
- <select class = "span2" >
- ...
- </select>
- <select class = "span3" >
- ...
- </select>
Rau ntau daim phiaj inputs ib kab, siv cov .controls-row
chav hloov kho kom haum qhov sib nrug . Nws ntab cov khoom nkag mus rau qhov chaw dawb-qhov chaw, teeb tsa cov npoo kom zoo, thiab tshem tawm cov ntab.
- <div class = "controls" >
- <input class = "span5" type = "text" placeholder = ".span5" >
- </div>
- <div class = "controls-kab" >
- <input class = "span4" type = "text" placeholder = ".span4" >
- <input class = "span1" type = "text" placeholder = ".span1" >
- </div>
- ...
Tshaj tawm cov ntaub ntawv hauv ib daim ntawv uas kho tsis tau yam tsis siv daim ntawv kos npe tiag tiag.
- <span class = "input-xlarge uneditable-input" > Qee tus nqi ntawm no </span>
Xaus daim ntawv nrog ib pab pawg ua haujlwm (khawm). Thaum muab tso rau hauv ib qho .form-actions
, cov nyees khawm yuav cia li nkag mus rau kab nrog cov ntawv tswj hwm.
- <div class = "form-actions" >
- <button type = "submit" class = "btn btn-primary" > Txuag hloov pauv </button>
- <button type = "button" class = "btn" > Ncua tseg </button>
- </div>
Inline thiab thaiv qib kev txhawb nqa rau kev pab cov ntawv uas tshwm nyob ib ncig ntawm daim ntawv tswj.
- <input type = "text" ><span class = "help-inline" > Inline pab ntawv </span>
- <input type = "text" ><span class = "help-block" > Ib qhov thaiv ntev ntawm kev pab cov ntawv uas tawg mus rau ib kab tshiab thiab tuaj yeem txuas ntxiv mus dhau ib kab. </span>
Muab cov lus tawm tswv yim rau cov neeg siv lossis cov neeg tuaj saib nrog cov lus qhia yooj yim hais txog cov ntawv tswj thiab cov ntawv sau.
Peb tshem tawm cov outline
qauv qub ntawm qee daim ntawv tswj hwm thiab siv ib qho box-shadow
hauv nws qhov chaw rau :focus
.
- <input class = "input-xlarge" id = "focusedInput" type = "text" tus nqi = "Qhov no yog tsom ..." >
Style inputs ntawm default browser functionality nrog :invalid
. Qhia meej a type
, ntxiv tus required
cwj pwm yog tias daim teb tsis yog xaiv tau, thiab (yog tias tsim nyog) qhia a pattern
.
Qhov no tsis muaj nyob rau hauv versions ntawm Internet Explorer 7-9 vim tsis muaj kev txhawb nqa rau CSS pseudo selectors.
- <input class = "span3" type = "email" xav tau >
Ntxiv tus disabled
cwj pwm ntawm ib qho kev tawm tswv yim los tiv thaiv cov neeg siv tswv yim thiab ua rau pom qhov txawv me ntsis.
- <input class = "input-xlarge" id = "disabledInput" type = "text" placeholder = "Disabled input here..." disabled >
Bootstrap suav nrog cov qauv kev lees paub rau kev ua yuam kev, ceeb toom, cov ntaub ntawv, thiab cov lus ua tiav. Txhawm rau siv, ntxiv cov chav kawm tsim nyog rau ib puag ncig .control-group
.
- <div class = "control-group ceeb toom" >
- <label class = "control-label" rau = "inputWarning" > Cov tswv yim nrog ceeb toom </label>
- <div class = "controls" >
- <input type = "text" id = "inputWarning" >
- <span class = "help-inline" > Ib yam dab tsi yuav mus tsis ncaj ncees lawm </span>
- </div>
- </div>
- <div class = "control-group yuam kev" >
- <label class = "control-label" for = "inputError" > Cov tswv yim nrog yuam kev </label>
- <div class = "controls" >
- <input type = "text" id = "inputError" >
- <span class = "help-inline" > Thov kho qhov yuam kev </span>
- </div>
- </div>
- <div class = "control-group info" >
- <label class = "control-label" for = "inputInfo" > Cov lus qhia nrog cov ntaub ntawv </label>
- <div class = "controls" >
- <input type = "text" id = "inputInfo" >
- <span class = "help-inline" > Tus neeg siv lub npe twb coj lawm </span>
- </div>
- </div>
- <div class = "control-group ua tau zoo" >
- <label class = "control-label" rau = "inputSuccess" > Cov tswv yim nrog kev vam meej </label>
- <div class = "controls" >
- <input type = "text" id = "inputSuccess" >
- <span class = "help-inline" > Woohoo! </span>
- </div>
- </div>
Ntxiv cov chav kawm rau ib <img>
lub caij kom yooj yim style dluab nyob rau hauv txhua qhov project.
- <img src = "..." class = "img-rounded" >
- <img src = "..." class = "img-circle" >
- <img src = "..." class = "img-polaroid" >
Tau taub hau! .img-rounded
thiab .img-circle
tsis ua haujlwm hauv IE7-8 vim tsis muaj kev border-radius
txhawb nqa.
140 icons nyob rau hauv daim ntawv sprite, muaj nyob rau hauv tsaus grey (default) thiab dawb, muab los ntawm Glyphicons .
Glyphicons Halflings ib txwm tsis muaj pub dawb, tab sis kev teeb tsa ntawm Bootstrap thiab Glyphicons creators tau ua qhov no tsis muaj nqi rau koj li cov neeg tsim khoom. Ua tsaug rau koj, peb hais kom koj suav nrog qhov kev xaiv txuas rov qab mus rau Glyphicons thaum twg los tau.
Txhua lub cim xav tau ib <i>
daim ntawv nrog cov chav kawm tshwj xeeb, ua ntej nrog icon-
. Txhawm rau siv, tso cov cai hauv qab no tsuas yog nyob txhua qhov chaw:
- <i class = "icon-search" ></i>
Tseem muaj cov qauv muaj rau inverted (dawb) icons, npaj txhij nrog ib chav kawm ntxiv. Peb yuav tshwj xeeb tswj cov chav kawm no ntawm hover thiab active xeev rau nav thiab dropdown links.
- <i class = "icon-search icon-white" ></i>
Tau taub hau!Thaum siv ib sab ntawm cov hlua ntawm cov ntawv nyeem, xws li hauv cov nyees khawm lossis cov kev sib txuas nav, nco ntsoov tawm qhov chaw tom qab lub <i>
cim rau qhov sib nrug.
Siv lawv nyob rau hauv cov nyees khawm, khawm pawg rau ib lub toolbar, navigation, los yog prepended daim ntawv inputs.
- <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> User </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-pencil" ></i> Edit </a></li>
- <li><a href = "#" ><i class = "icon-trash" ></i> Delete </a></li>
- <li><a href = "#" ><i class = "icon-ban-circle" ></i> Ban </a></li>
- <li class = "divider" ></li>
- <li><a href = "#" ><i class = "i" ></i> Ua admin </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> Home </a></li>
- <li><a href = "#" ><i class = "icon-book" ></i> Library </a></li>
- <li><a href = "#" ><i class = "icon-pencil" ></i> Applications </a></li>
- <li><a href = "#" ><i class = "i" ></i> Misc </a></li>
- </ul>
- <div class = "control-group" >
- <label class = "control-label" rau = "inputIcon" > Email chaw nyob </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>