Cheebtsam

Kaum ob ntawm cov khoom siv rov siv tau yog tsim rau hauv Bootstrap los muab kev taw qhia, ceeb toom, popovers, thiab ntau ntxiv.

Khawm pawg

Siv cov pab pawg khawm kom koom nrog ntau lub nyees khawm ua ke ua ib qho kev sib xyaw ua ke. Ua lawv nrog cov series <a>los yog <button>cov ntsiab lus.

Cov kev coj ua zoo tshaj plaws

Peb pom zoo cov lus qhia hauv qab no rau kev siv khawm pawg thiab toolbars:

  • Ib txwm siv tib lub caij hauv ib pawg khawm, <a>lossis <button>.
  • Tsis txhob sib tov cov nyees khawm ntawm cov xim sib txawv hauv tib pawg khawm.
  • Siv cov cim ntxiv rau lossis hloov cov ntawv, tab sis nco ntsoov suav nrog alt thiab cov ntawv sau npe yog qhov tsim nyog.

Cov pawg khawm cuam tshuam nrog kev poob qis (saib hauv qab) yuav tsum raug hu tawm nyias thiab ib txwm suav nrog kev saib xyuas kev poob qis los qhia tus cwj pwm xav.

Piv txwv li

Nov yog yuav ua li cas HTML saib rau cov txheej txheem khawm pawg tsim nrog thauj tog rau nkoj tag khawm:

  1. <div class = "btn-group" >
  2. <button class = "btn" > 1 </button>
  3. <button class = "btn" > 2 </button>
  4. <button class = "btn" > 3 </button>
  5. </div>

Toolbar piv txwv

Muab cov khoom sib xyaw ua ke <div class="btn-group">rau hauv ib qho <div class="btn-toolbar">rau ntau qhov sib txawv.

  1. <div class = "btn-toolbar" >
  2. <div class = "btn-group" >
  3. ...
  4. </div>
  5. </div>

Checkbox thiab xov tooj cua flavors

Cov pab pawg khawm kuj tseem tuaj yeem ua haujlwm raws li xov tooj cua, qhov twg tsuas yog ib lub pob tuaj yeem ua haujlwm, lossis checkboxes, qhov twg cov nyees khawm yuav ua haujlwm. Saib Javascript docs rau qhov ntawd.

Tau txais javascript »

Dropdowns hauv pawg khawm

Tau taub hau! Cov nyees khawm nrog dropdowns yuav tsum tau muab qhwv rau hauv lawv tus kheej .btn-grouphauv ib qho .btn-toolbarkev ua kom zoo.

Khawm dropdowns

Txheej txheem cej luam thiab piv txwv

Siv ib lub pob kom ua rau cov ntawv qhia poob qis los ntawm qhov muab tso rau hauv ib qho .btn-groupthiab muab cov ntawv qhia zaub mov kom raug.

Piv txwv markup

Zoo ib yam li ib pab pawg khawm, peb cov cim siv lub pob khawm tsis tu ncua, tab sis nrog ib qho ntxiv ntawm cov khoom ntxiv los kho cov qauv thiab txhawb nqa Bootstrap lub dropdown jQuery plugin.

  1. <div class = "btn-group" >
  2. <a class = "btn dropdown-toggle" data-toggle = "dropdown" href = "#" >
  3. Kev ua
  4. <span dir = "ltr" >Tswv Yim Vaj</span>
  5. </a>
  6. <ul class = "dropdown-menu" >
  7. <!-- dropdown menu links -->
  8. </ul>
  9. </div>

Ua haujlwm nrog txhua qhov ntau thiab tsawg khawm

Khawm dropdowns ua haujlwm ntawm txhua qhov loj. koj lub khawm loj rau .btn-large, .btn-small, lossis .btn-mini.

Yuav tsum muaj javascript

Khawm dropdowns xav tau Bootstrap dropdown plugin ua haujlwm.

Qee qhov xwm txheej - zoo li lub xov tooj ntawm tes - cov ntawv qhia zaub mov poob yuav nthuav tawm sab nraum qhov chaw saib. Koj yuav tsum daws qhov kev sib tw manually lossis nrog kev cai javascript.


Split khawm dropdowns

Txheej txheem cej luam thiab piv txwv

Lub tsev nyob rau hauv cov khawm pab pawg neeg style thiab markup, peb tuaj yeem yooj yim tsim lub pob phua. Split nyees khawm muaj cov txheej txheem ua haujlwm nyob rau sab laug thiab lub dropdown toggle ntawm sab xis nrog cov ntsiab lus txuas.

Qhov ntau thiab tsawg

Siv cov chav kawm khawm ntxiv .btn-mini, .btn-small, lossis .btn-largerau qhov loj me.

  1. <div class = "btn-group" >
  2. ...
  3. <ul class = "dropdown-menu pull-right" >
  4. <!-- dropdown menu links -->
  5. </ul>
  6. </div>

Piv txwv markup

Peb nthuav dav ntawm qhov ib txwm khawm dropdowns los muab lub khawm thib ob uas ua haujlwm ua ib qho kev sib cais.

  1. <div class = "btn-group" >
  2. <button class = "btn" > Action </button>
  3. <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
  4. <span dir = "ltr" >Tswv Yim Vaj</span>
  5. </button>
  6. <ul class = "dropdown-menu" >
  7. <!-- dropdown menu links -->
  8. </ul>
  9. </div>

Dropup menus

Dropdown menus kuj tuaj yeem toggled los ntawm hauv qab los ntawm kev ntxiv ib chav kawm rau niam txiv tam sim ntawm .dropdown-menu. Nws yuav tig cov kev taw qhia ntawm .caretthiab reposition cov ntawv qhia zaub mov nws tus kheej kom txav los ntawm hauv qab mus rau saum toj.

  1. <div class = "btn-group dropup" >
  2. <button class = "btn" > Dropup </button>
  3. <button class = "btn dropdown-toggle" data-toggle = "dropdown" >
  4. <span dir = "ltr" >Tswv Yim Vaj</span>
  5. </button>
  6. <ul class = "dropdown-menu" >
  7. <!-- dropdown menu links -->
  8. </ul>
  9. </div>

Multicon-nplooj pagination

Thaum siv

Ultra simplistic thiab minimally styled pagination tshwm sim los ntawm Rdio, zoo rau cov apps thiab tshawb nrhiav. Qhov loj thaiv yog ib qho nyuaj rau nco, yooj yim scalable, thiab muab loj nias qhov chaw.

Stateful nplooj ntawv links

Kev sib txuas yog customizable thiab ua hauj lwm nyob rau hauv ib tug xov tooj ntawm cov xwm txheej nrog rau cov chav kawm zoo. .disabledrau unclickable links thiab .activerau nplooj ntawv tam sim no.

Hloov kho kom haum

Ntxiv ob qho ntawm ob chav kawm xaiv los hloov qhov kev sib tw ntawm kev sib txuas ntawm pagination: .pagination-centeredthiab .pagination-right.

Piv txwv

Lub default pagination tivthaiv yog hloov tau thiab ua haujlwm nyob rau hauv ib tug xov tooj ntawm variations.

Markup

qhwv hauv ib <div>, pagination tsuas yog ib <ul>.

  1. <div class = "pagination" >
  2. <ul>
  3. <li><a href = "#" > Prev </a></li>
  4. <li class = "active" >
  5. <a href="#"> 1 </a> _ _ _
  6. </li>
  7. <li><a href = "#" > 2 </a></li>
  8. <li><a href = "#" > 3 </a></li>
  9. <li><a href = "#" > 4 ​​</a></li>
  10. <li><a href = "#" > Next </a></li>
  11. </ul>
  12. </div>

Pager Rau nrawm dhau los thiab txuas ntxiv tom ntej

Hais txog pager

Cov tshuaj tivthaiv pager yog ib txheej txuas rau kev siv pagination yooj yim nrog lub teeb cim thiab txawm tias sib dua. Nws yog qhov zoo rau cov chaw yooj yim xws li blogs lossis cov ntawv xov xwm.

Xaiv lub xeev tsis taus

Pager links kuj siv cov .disabledchav kawm dav dav los ntawm pagination.

Piv txwv li

Los ntawm lub neej ntawd, pager chaw txuas.

  1. <ul class = "pager" >
  2. <li>
  3. <a href="#"> Previous </a> _ _ _
  4. </li>
  5. <li>
  6. <a href="#"> Tom ntej </a> _ _
  7. </li>
  8. </ul>

Aligned links

Xwb, koj tuaj yeem kho txhua qhov txuas mus rau sab:

  1. <ul class = "pager" >
  2. <li class = "previous" >
  3. <a href="#"> & larr ; _ Laus </a>
  4. </li>
  5. <li class = "next" >
  6. <a href="#"> Tshiab & rarr ; </a>
  7. </li>
  8. </ul>
Daim ntawv lo Markup
Default <span class="label">Default</span>
Kev vam meej <span class="label label-success">Success</span>
Ceeb toom <span class="label label-warning">Warning</span>
Tseem ceeb <span class="label label-important">Important</span>
Cov ntaub ntawv <span class="label label-info">Info</span>
Rov qab <span class="label label-inverse">Inverse</span>

Txog

Cov paib yog cov khoom me me, yooj yim rau kev nthuav qhia qhov taw qhia lossis suav ntawm qee yam. Lawv feem ntau pom nyob rau hauv cov neeg siv email xws li Mail.app lossis ntawm cov ntawv xov tooj ntawm tes rau kev ceeb toom thawb.

Muaj cov chav kawm

Lub npe Piv txwv Markup
Default 1 <span class="badge">1</span>
Kev vam meej 2 <span class="badge badge-success">2</span>
Ceeb toom 4 <span class="badge badge-warning">4</span>
Tseem ceeb 6 <span class="badge badge-important">6</span>
Cov ntaub ntawv 8 <span class="badge badge-info">8</span>
Rov qab 10 <span class="badge badge-inverse">10</span>

Hero unit

Bootstrap muab lub teeb yuag, hloov tau yooj yim hu ua chav tsev hero los nthuav qhia cov ntsiab lus ntawm koj qhov chaw. Nws ua haujlwm zoo ntawm kev lag luam thiab cov ntsiab lus-hnyav qhov chaw.

Markup

Qhwv koj cov ntsiab lus hauv ib divyam li ntawd:

  1. <div class = "hero-unit" >
  2. <h1> Lub taub hau </h1>
  3. <p> Tagline </p>
  4. <p>
  5. <a class = "btn btn-primary btn-large" >
  6. Kawm ntxiv
  7. </a>
  8. </p>
  9. </div>

Nyob zoo, ntiaj teb!

Qhov no yog ib qho yooj yim hero unit, ib qho yooj yim jumbotron-style tivthaiv rau kev hu xov tooj ntxiv rau cov ntsiab lus tshwj xeeb lossis cov ntaub ntawv.

Kawm ntxiv

Nplooj ntawv

Lub plhaub yooj yim rau qhov h1kom tsim nyog qhov chaw tawm thiab ntu ntu ntawm cov ntsiab lus ntawm nplooj ntawv. Nws tuaj yeem siv lub h1neej ntawd small, lub ntsiab lus thiab feem ntau lwm yam khoom (nrog rau cov qauv ntxiv).

  1. <div class = "page-header" >
  2. <h1> Piv txwv nplooj ntawv header </h1>
  3. </div>

Cov duab me me

Los ntawm lub neej ntawd, Bootstrap's thumbnails yog tsim los qhia cov duab txuas nrog tsawg kawg yuav tsum tau kos.

Kho siab heev

Nrog me ntsis ntawm cov cim ntxiv, nws muaj peev xwm ntxiv txhua hom HTML cov ntsiab lus xws li kab lus, kab lus, lossis cov nyees khawm rau hauv cov duab me.

  • Thumbnail daim ntawv lo

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    Kev ua Kev ua

  • Thumbnail daim ntawv lo

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    Kev ua Kev ua

Vim li cas thiaj siv cov duab me

Thumbnails (yav dhau .media-gridlos txog v1.4) yog qhov zoo rau daim phiaj duab lossis cov yeeb yaj kiab, cov duab tshawb nrhiav, cov khoom muag, cov ntaub ntawv, thiab ntau ntxiv. Lawv tuaj yeem yog cov ntawv txuas lossis cov ntsiab lus zoo li qub.

Yooj yim, saj zawg zog markup

Thumbnail markup yog qhov yooj yim - ulnrog ib tus lej ntawm licov ntsiab lus yog txhua yam uas yuav tsum tau ua. Nws kuj tseem hloov tau yooj yim, tso cai rau txhua hom ntsiab lus nrog me ntsis ntxiv cim los qhwv koj cov ntsiab lus.

Siv daim phiaj kab loj

Thaum kawg, cov duab thumbnails siv cov chav kawm kab sib chaws uas twb muaj lawm - zoo li .span2lossis .span3- rau kev tswj cov duab me me.

Lub markup

Raws li tau hais dhau los, qhov yuav tsum tau kos npe rau cov duab me me yog lub teeb thiab ncaj nraim. Nov yog saib ntawm qhov teeb tsa ua ntej rau cov duab txuas :

  1. <ul class = "thumbnails" >
  2. <li class = "span3" >
  3. <a href="#" class = "thumbnail"> _ _ _
  4. <img src = "https://placehold.it/260x180" alt = "" >
  5. </a>
  6. </li>
  7. ...
  8. </ul>

Rau kev cai HTML cov ntsiab lus hauv cov duab me, cov cim hloov me ntsis. Txhawm rau tso cai thaiv cov ntsiab lus nyob txhua qhov chaw, peb sib pauv qhov <a>zoo <div>li:

  1. <ul class = "thumbnails" >
  2. <li class = "span3" >
  3. <div class = "thumbnail" >
  4. <img src = "https://placehold.it/260x180" alt = "" >
  5. <h5> Thumbnail label </h5>
  6. <p> Tub Nuj Nplhaib txoj nkauj no... </p>
  7. </div>
  8. </li>
  9. ...
  10. </ul>

Piv txwv ntxiv

Tshawb nrhiav tag nrho koj cov kev xaiv nrog ntau cov chav kawm kab sib chaws muaj rau koj. Koj tseem tuaj yeem sib xyaw thiab sib txawv qhov ntau thiab tsawg.

Lub teeb defaults

Rewritten base class

Nrog Bootstrap 2, peb tau simplified lub hauv paus chav kawm: .alerttsis yog .alert-message. Peb kuj tau txo qhov tsawg kawg nkaus uas yuav tsum tau kos npe - tsis <p>yog yuav tsum tau los ntawm lub neej ntawd, tsuas yog sab nrauv <div>.

Cov lus ceeb toom ib leeg

Rau cov khoom siv ruaj khov dua nrog cov lej tsawg, peb tau tshem tawm qhov sib txawv saib rau kev ceeb toom thaiv, cov lus uas tuaj nrog ntau dua padding thiab feem ntau cov ntawv nyeem ntau dua. Cov chav kawm kuj tau hloov mus rau .alert-block.


Mus zoo nrog javascript

Bootstrap los nrog lub zoo jQuery plugin uas txhawb cov lus ceeb toom, ua rau lawv tshem tawm sai thiab yooj yim.

Tau lub plugin »

Piv txwv ceeb toom

Qhwv koj cov lus thiab ib qho kev xaiv kaw icon hauv div nrog chav kawm yooj yim.

Ceeb toom! Qhov zoo tshaj plaws xyuas koj tus kheej, koj tsis zoo heev.
  1. <div class = "alert" >
  2. <button class = "kaw" data-dismiss = "alert" > × </button>
  3. <strong> Ceeb toom! </strong> Zoo tshaj koj tus kheej, koj tsis saib zoo heev.
  4. </div>

Tau taub hau! iOS pab kiag li lawm xav tau ib tug href="#"rau kev tso tseg ntawm ceeb toom. Nco ntsoov suav nrog nws thiab cov ntaub ntawv tus cwj pwm rau thauj tog rau nkoj kaw icons. Xwb, koj tuaj yeem siv lub <button>caij nrog cov ntaub ntawv tus cwj pwm, uas peb tau xaiv ua rau peb cov ntaub ntawv. Thaum siv <button>, koj yuav tsum suav nrog type="button"lossis koj cov ntawv yuav tsis xa tuaj.

Yooj yim txuas ntxiv cov lus ceeb toom tus qauv nrog ob chav kawm xaiv: .alert-blockrau ntau qhov padding thiab cov ntawv nyeem thiab .alert-headingrau cov lus sib xws.

Ceeb toom!

Qhov zoo tshaj plaws xyuas koj tus kheej, koj tsis zoo heev. Nulla vitae elit libero, pharetra auggue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  1. <div class = "alert-block" >
  2. <a class = "kaw" data-dismiss = "alert" href = "#" > × </a>
  3. <h4 class = "alert-heading" > Ceeb toom! </h4>
  4. Best check koj tus kheej, koj tsis yog ...
  5. </div>

Contextualalterns Ntxiv cov chav kawm uas xaiv tau los hloov qhov kev ceeb toom lub ntsiab lus

yuam kev los yog txaus ntshai

Aw snap! Hloov ob peb yam thiab sim xa rov qab.
  1. <div class = "alert alert-error" >
  2. ...
  3. </div>

Kev vam meej

Ua tau zoo! Koj ua tiav nyeem cov lus ceeb toom tseem ceeb no.
  1. <div class = "alert-success" >
  2. ...
  3. </div>

Cov ntaub ntawv

Tau taub hau! Qhov kev ceeb toom no xav tau koj cov xim, tab sis nws tsis yog qhov tseem ceeb heev.
  1. <div class = "alert-info" >
  2. ...
  3. </div>

Piv txwv thiab markup

Basic

Default kev nce qib bar nrog ntsug gradient.

  1. <div class = "progress" >
  2. <div class = "bar"
  3. style = " width : 60 %; " ></div>
  4. </div>

striped

Siv cov gradient los tsim cov nyhuv striped (tsis muaj IE).

  1. <div class = "progress-striped" >
  2. <div class = "bar"
  3. style = " width : 20 %; " ></div>
  4. </div>

Animated

Siv tus qauv kab txaij thiab ua rau nws (tsis muaj IE).

  1. <div class = "progress-striped
  2. active" >
  3. <div class = "bar"
  4. style = " width : 40 %; " ></div>
  5. </div>

Kev xaiv thiab kev txhawb nqa browser

Cov xim ntxiv

Cov kab kev nce qib siv qee qhov tib lub pob thiab ceeb toom cov chav kawm rau cov qauv zoo ib yam.

Cov kab txaij

Zoo ib yam li cov xim xim, peb muaj cov kab txaij sib txawv.

Cwj pwm

Kev nce qib bar siv CSS3 kev hloov pauv, yog li yog tias koj hloov kho qhov dav ntawm javascript, nws yuav hloov kho kom zoo.

Yog tias koj siv .activechav kawm, koj .progress-stripedqhov kev kawm bar yuav ua rau cov kab txaij sab laug mus rau sab xis.

Kev them nyiaj yug browser

Cov kab nce qib siv CSS3 gradients, kev hloov pauv, thiab cov animations kom ua tiav tag nrho lawv cov teebmeem. Cov yam ntxwv no tsis txaus siab hauv IE7-9 lossis cov laus dua ntawm Firefox.

Opera thiab IE tsis txhawb cov animations nyob rau lub sijhawm no.

Wells

Siv lub qhov dej zoo li cov nyhuv yooj yim ntawm ib lub caij los muab nws cov nyhuv inset.

Saib, kuv nyob hauv lub qhov dej!
  1. <div class = "zoo" >
  2. ...
  3. </div>

Kaw lub cim

Siv lub cim ze ze rau kev tso tawm cov ntsiab lus xws li modals thiab ceeb toom.

  1. <button class = "kaw" > × </button>

iOS pab kiag li lawm yuav tsum tau ib tug href="#" rau nias cov xwm txheej yog tias koj xav siv lub thauj tog rau nkoj.

  1. <a class = "kaw" href = "#" > × </a>