Inqwaba yezingxenye ezingasebenziseka kabusha ezakhelwe ukuhlinzeka ngokuzulazula, izexwayiso, ama-popovers, nokuningi.
Imenyu eguqukayo, engokomongo yokubonisa izinhlu zezixhumanisi. Kwenziwe ukusebenzisana nokwehliswa kwe- JavaScript plugin .
- <ul class = "dropdown-menu" role = "imenyu" aria-labelledby = "dropdownMenu" >
- <li><a tabindex = "-1" href = "#" > Isenzo </a></li>
- <li><a tabindex = "-1" href = "#" > Esinye isenzo </a></li>
- <li><a tabindex = "-1" href = "#" > Okunye okunye lapha </a></li>
- <li class = "divider" ></li>
- <li><a tabindex = "-1" href = "#" > Isixhumanisi esihlukanisiwe </a></li>
- </ul>
Uma ubheka imenyu yokudonsela phansi, nansi i-HTML edingekayo. Udinga ukugoqa i-trigger yokudonsela phansi kanye nemenyu yokudonsela phansi ngaphakathi kokuthi .dropdown
, noma enye into esho ukuthi position: relative;
. Bese uvele udale imenyu.
- <div class = "okwehlayo" >
- <!-- Xhumanisa noma inkinobho yokuguqula okwehliswayo -->
- <ul class = "dropdown-menu" role = "imenyu" aria-labelledby = "dLabel" >
- <li><a tabindex = "-1" href = "#" > Isenzo </a></li>
- <li><a tabindex = "-1" href = "#" > Esinye isenzo </a></li>
- <li><a tabindex = "-1" href = "#" > Okunye okunye lapha </a></li>
- <li class = "divider" ></li>
- <li><a tabindex = "-1" href = "#" > Isixhumanisi esihlukanisiwe </a></li>
- </ul>
- </div>
Qondanisa amamenyu kwesokudla bese wengeza kufaka phakathi amazinga engeziwe okwehlayo.
Engeza .pull-right
kokuthi a .dropdown-menu
ukuze uqondanise kwesokudla imenyu eyehlayo.
- <ul class = "imenyu eyehlayo donsa-kwesokudla" role = "imenyu" aria-labelledby = "dLabel" >
- ...
- </ul>
Engeza .disabled
kokuthi a <li>
kokwehlayo ukuze ukhubaze isixhumanisi.
- <ul class = "dropdown-menu" role = "imenyu" aria-labelledby = "dropdownMenu" >
- <li><a tabindex = "-1" href = "#" > Isixhumanisi esijwayelekile </a></li>
- <li class = "disabled" ><a tabindex = "-1" href = "#" > Isixhumanisi esivaliwe </a></li>
- <li><a tabindex = "-1" href = "#" > Esinye isixhumanisi </a></li>
- </ul>
Engeza ileveli eyengeziwe yamamenyu okwehlayo, avela phezulu njengalawo e-OS X, anezengezo zemakhaphu ezilula. Engeza .dropdown-submenu
kunoma iyiphi li
kumenyu eyehlayo ekhona ukuze wenze isitayela esizenzakalelayo.
- <ul class = "dropdown-menu" role = "imenyu" aria-labelledby = "dLabel" >
- ...
- <li class = "imenu engezansi yokudonsela phansi" >
- <a tabindex = "-1" href = "#" > Izinketho eziningi </a>
- <ul class = "imenyu eyehlayo" >
- ...
- </ul>
- </li>
- </ul>
Ukuqanjwa okulula okukhuthazwe yi-Rdio, kulungele izinhlelo zokusebenza nemiphumela yosesho. Ibhulokhi enkulu kunzima ukuyigeja, ingakala kalula, futhi ihlinzeka ngezindawo ezinkulu zokuchofoza.
- <div class = "pagination" >
- <ul>
- <li><a href = "#" > Okwedlule </a></li>
- <li><a href = "#" > 1 </a></li>
- <li><a href = "#" > 2 </a></li>
- <li><a href = "#" > 3 </a></li>
- <li><a href = "#" > 4 </a></li>
- <li><a href = "#" > 5 </a></li>
- <li><a href = "#" > Okulandelayo </a></li>
- </ul>
- </div>
Izixhumanisi zingenziwa ngendlela oyifisayo ezimeni ezahlukene. Sebenzisa .disabled
izixhumanisi ezingachofozwayo kanye .active
nokukhombisa ikhasi lamanje.
- <div class = "pagination" >
- <ul>
- <li class = "disabled" ><a href = "#" > « </a></li>
- <li class = "active" > <a href = "#"> 1 </a></li>
- ...
- </ul>
- </div>
Ungashintsha ngokuzithandela amahange asebenzayo noma akhutshaziwe ukuze uthole izikhala ukuze ususe ukusebenza kokuchofoza kuyilapho ugcina izitayela ezihlosiwe.
- <div class = "pagination" >
- <ul>
- <li class = "ikhubazekile" ><span> « </span></li>
- <li class = "active" ><span> 1 </span></li>
- ...
- </ul>
- </div>
Uyathanda ukuqanjwa okukhudlwana noma okuncane? Engeza .pagination-large
, .pagination-small
, noma .pagination-mini
osayizi abengeziwe.
- <div class = "pagination-large" >
- <ul>
- ...
- </ul>
- </div>
- <div class = "pagination" >
- <ul>
- ...
- </ul>
- </div>
- <div class = "pagination-small" >
- <ul>
- ...
- </ul>
- </div>
- <div class = "pagination pagination-mini" >
- <ul>
- ...
- </ul>
- </div>
Engeza izigaba ezimbili ozikhethela ukuze uguqule ukuqondanisa kwezixhumanisi zamakhasi: .pagination-centered
kanye .pagination-right
.
- <div class = "i-pagination-centered" >
- ...
- </div>
- <div class = "pagination-right" >
- ...
- </div>
Izixhumanisi ezisheshayo zangaphambilini nezilandelayo zokusetshenziswa okulula kokwakheka kwamagama okunophawu olukhanyayo nezitayela. Ilungele amasayithi alula njengamabhulogi noma omagazini.
Ngokuzenzakalela, izixhumanisi ze-pager.
- <ul class = "pager" >
- <li><a href = "#" > Okwedlule </a></li>
- <li><a href = "#" > Okulandelayo </a></li>
- </ul>
Kungenjalo, ungakwazi ukuqondanisa isixhumanisi ngasinye emaceleni:
- <ul class = "pager" >
- <li class = "previous" >
- <a href = "#" > ← Okudadlana </a>
- </li>
- <li class = "okulandelayo" >
- <a href = "#" > Okusha → </a>
- </li>
- </ul>
Izixhumanisi zama-pager nazo zisebenzisa okuvamile.disabled
kusuka ephepheni.
- <ul class = "pager" >
- <li class = "kukhutshazwe kwangaphambilini" >
- <a href = "#" > ← Omdala </a>
- </li>
- ...
- </ul>
Amalebula | Imakhaphu |
---|---|
Okuzenzakalelayo | <span class="label">Default</span> |
Impumelelo | <span class="label label-success">Success</span> |
Isexwayiso | <span class="label label-warning">Warning</span> |
Okubalulekile | <span class="label label-important">Important</span> |
Ulwazi | <span class="label label-info">Info</span> |
Okuphambene | <span class="label label-inverse">Inverse</span> |
Igama | Isibonelo | Imakhaphu |
---|---|---|
Okuzenzakalelayo | 1 | <span class="badge">1</span> |
Impumelelo | 2 | <span class="badge badge-success">2</span> |
Isexwayiso | 4 | <span class="badge badge-warning">4</span> |
Okubalulekile | 6 | <span class="badge badge-important">6</span> |
Ulwazi | 8 | <span class="badge badge-info">8</span> |
Okuphambene | 10 | <span class="badge badge-inverse">10</span> |
Ukuze kusetshenziswe kalula, amalebula namabheji azovele agoqe (ngesikhethi se-CSS :empty
) uma kungekho okuqukethwe ngaphakathi.
Ingxenye engasindi, evumelana nezimo ukuze ubonise okuqukethwe okuyinhloko kusayithi lakho. Isebenza kahle kumasayithi okuthengisa kanye nokuqukethwe okusindayo.
Leli iyunithi yeqhawe elilula, ingxenye elula yesitayela se-jumbotron yokubiza ukunaka okwengeziwe kokuqukethwe okufakiwe noma ulwazi.
- <div class = "hero-unit" >
- <h1> Isihloko </h1>
- <p> Ulayini wethegi </p>
- <p>
- <a class = "btn btn-primary btn-large" >
- Funda kabanzi
- </a>
- </p>
- </div>
Igobolondo elilula h1
lendawo yokukhipha ngokufanelekile futhi uhlukanise izingxenye zokuqukethwe ekhasini. Ingasebenzisa h1
okumisiwe small
, ingxenye kanye nezinye izingxenye eziningi (ngezitayela ezengeziwe).
- <div class = "isihloko sekhasi" >
- <h1> Iheda yekhasi eliyisibonelo <small> Umbhalo ongezansi weheda </small></h1>
- </div>
Ngokuzenzakalelayo, izithonjana ze-Bootstrap ziklanyelwe ukubonisa izithombe ezixhunyiwe ezinomakhaphu omncane odingekayo.
Ngophawu oluthe xaxa, ungakwazi ukwengeza noma yiluphi uhlobo lokuqukethwe kwe-HTML njengezihloko, izigaba, noma izinkinobho ezithonjaneni.
Izithonjana (ngaphambilini .media-grid
kuze kufike ku-v1.4) zinhle kumagridi ezithombe noma amavidiyo, imiphumela yosesho lwezithombe, imikhiqizo yokudayisa, amaphothifoliyo, nokunye okuningi. Kungaba izixhumanisi noma okuqukethwe okumile.
Umaki wezithonjana ulula—okunanoma ul
iyiphi inombolo li
yezinto yikho kuphela okudingekayo. Futhi iguquguquka kakhulu, ivumela noma iluphi uhlobo lokuqukethwe olunomakhaphu owengeziwe wokugoqa okuqukethwe kwakho.
Okokugcina, ingxenye yezithonjana isebenzisa amakilasi esistimu yegridi ekhona— .span2
njenganoma.span3
ubukhulu bezithonjana.
Njengoba kushiwo ngaphambili, umaka odingekayo wezithonjana ulula futhi uqondile. Nakhu ukubheka ukusethwa okuzenzakalelayo kwezithombe ezixhunyiwe :
- <ul class = "izithonjana" >
- <li class = "span4" >
- <a href = "#" class = "isithonjana" >
- <img data-src = "holder.js/300x200" alt = "" >
- </a>
- </li>
- ...
- </ul>
Ngokuqukethwe kwe-HTML yangokwezifiso ezithonjaneni, umaki uyashintsha kancane. Ukuvumela okuqukethwe kweleveli yebhulokhi noma yikuphi, sishintshanisa <a>
okufana <div>
nalokhu:
- <ul class = "izithonjana" >
- <li class = "span4" >
- <div class = "isithonjana" >
- <img data-src = "holder.js/300x200" alt = "" >
- <h3> Ilebula yesithonjana </h3>
- <p> Amazwibela esithonjana... </p>
- </div>
- </li>
- ...
- </ul>
Hlola zonke izinketho zakho ngamakilasi egridi ahlukahlukene atholakalayo kuwe. Ungaphinda uhlanganise futhi ufanise osayizi abahlukene.
Goqa noma yimuphi umbhalo kanye nenkinobho yokuchitha ngokuzithandela .alert
ukuze uthole umlayezo oyisisekelo wesexwayiso.
- <div class = "isaziso" >
- <button type = "button" class = "close" data-dismiss = "alert" > × </inkinobho>
- <strong> Isexwayiso! I </strong> Zihlole kahle, awubukeki umuhle kakhulu.
- </div>
Iziphequluli ze-Mobile Safari ne-Mobile Opera, ngaphezu data-dismiss="alert"
kwesibaluli, zidinga href="#"
ukuchithwa kwezixwayiso uma usebenzisa <a>
ithegi.
- <a href = "#" class = "close" data-dismiss = "alert" > × </a>
Kungenjalo, ungasebenzisa i- <button>
elementi enesibaluli sedatha, esikhethe ukuyenzela amadokhumenti ethu. Uma usebenzisa <button>
, kufanele ufake type="button"
noma amafomu akho angase angawahambisi.
- <button type = "button" class = "close" data-dismiss = "alert" > × </inkinobho>
Sebenzisa i- plugin yezaziso ye-jQuery ukuze ukhiphe izaziso ngokushesha futhi kalula.
Ngemilayezo emide, khulisa ukupheda phezulu nangaphansi kwesisonga sesexwayiso ngokungeza .alert-block
.
Kungcono uzihlole kahle, awubukeki umuhle kakhulu. I-Nulla vitae elit libero, i-pharetra augue. I-Preesent commodo cursus magna, vel scelerisque nisl consectetur et.
- <div class = "i-alert alert-block" >
- <button type = "button" class = "close" data-dismiss = "alert" > × </inkinobho>
- <h4> Isexwayiso! </h4>
- Okungcono uzihlole wena, awu...
- </div>
Engeza amakilasi ongawakhetha ukuze uguqule incazelo yesexwayiso.
- <div class = "iphutha lesaziso" >
- ...
- </div>
- <div class = "impumelelo yesixwayiso" >
- ...
- </div>
- <div class = "ulwazi lwesixwayiso" >
- ...
- </div>
Ibha yokuqhubeka ezenzakalelayo enegradient eqondile.
- <div class = "progress" >
- <div class = "bar" style = " wide : 60 %; " ></div>
- </div>
Isebenzisa i-gradient ukuze idale umphumela onemigqa. Ayitholakali ku-IE7-8.
- <div class = "progress progress-striped" >
- <div class = "bar" style = " wide : 20 %; " ></div>
- </div>
Engeza .active
ukuze .progress-striped
uphilise imithende kwesokudla ukuya kwesokunxele. Ayitholakali kuzo zonke izinguqulo ze-IE.
- <div class = "inqubekelaphambili-imigqa esebenzayo" >
- <div class = "bar" style = " wide : 40 %; " ></div>
- </div>
Beka amabha amaningi okufanayo .progress
ukuze uwabeke.
- <div class = "progress" >
- <div class = "bar-success" style = " wide : 35 %; " ></div>
- <div class = "bar-warning" style = " ububanzi : 20 %; " ></div>
- <div class = "bar-danger" style = " wide : 10 %; " ></div>
- </div>
Amabha okuqhubeka asebenzisa inkinobho efanayo namakilasi okuxwayisa ngezitayela ezingaguquki.
- <div class = "progress progress-info" >
- <div class = "bar" style = " width : 20 % " ></div>
- </div>
- <div class = "inqubekelaphambili-impumelelo" >
- <div class = "bar" style = " width : 40 % " ></div>
- </div>
- <div class = "inqubekelaphambili-isixwayiso" >
- <div class = "bar" style = " width : 60 % " ></div>
- </div>
- <div class = "progress progress-danger" >
- <div class = "bar" style = " width : 80 % " ></div>
- </div>
Ngokufana nemibala eqinile, sinemigoqo yenqubekelaphambili enemigqa ehlukahlukene.
- <div class = "progress progress-info progress-striped" >
- <div class = "bar" style = " width : 20 % " ></div>
- </div>
- <div class = "inqubekelaphambili-impumelelo inqubekelaphambili-imigqa" >
- <div class = "bar" style = " width : 40 % " ></div>
- </div>
- <div class = "inqubekelaphambili-isixwayiso senqubekelaphambili-imigqa" >
- <div class = "bar" style = " width : 60 % " ></div>
- </div>
- <div class = "inqubekelaphambili-inqubekela phambili-ingozi-imigqa" >
- <div class = "bar" style = " width : 80 % " ></div>
- </div>
Amabha wokuqhubeka asebenzisa ama-gradient e-CSS3, ukuguqulwa, nokugqwayiza ukuze kuzuzwe yonke imiphumela yakhona. Lezi zici azisekelwa kuzinguqulo ze-IE7-9 noma ezindala zeFirefox.
Izinguqulo zangaphambi kwe-Internet Explorer 10 ne-Opera 12 azikusekeli ukugqwayiza.
Izitayela zento engabonakali zokwakha izinhlobo ezihlukahlukene zezingxenye (njengamazwana ebhulogi, ama-Tweets, njll) anesithombe esiqondaniswe kwesokunxele noma kwesokudla eceleni kokuqukethwe kombhalo.
Imidiya ezenzakalelayo ivumela ukuntanta into yemidiya (izithombe, ividiyo, umsindo) iye kwesokunxele noma kwesokudla sebhulokhi yokuqukethwe.
- <div class = "media" >
- <a class = "pull-left" href = "#" >
- <img class = "media-object" data-src = "holder.js/64x64" >
- </a>
- <div class = "media-body" >
- <h4 class = "media-heading" > Isihloko semidiya </h4>
- ...
- <!-- Into yemidiya efakwe esidlekeni -->
- <div class = "media" >
- ...
- </div>
- </div>
- </div>
Ngemakhaphu eyengeziwe, ungasebenzisa imidiya engaphakathi kohlu (iwusizo ochungechungeni lwamazwana noma uhlu lwama-athikili).
Cras sit amet nibh libero, in gravida nulla. I-Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
- <ul class = "media-list" >
- <li class = "media" >
- <a class = "pull-left" href = "#" >
- <img class = "media-object" data-src = "holder.js/64x64" >
- </a>
- <div class = "media-body" >
- <h4 ikilasi = "media-heading" > Isihloko semidiya </h4>
- ...
- <!-- Into yemidiya efakwe esidlekeni -->
- <div class = "media" >
- ...
- </div>
- </div>
- </li>
- </ul>
Sebenzisa umthombo njengomphumela olula ku-elementi ukuze uyinikeze umphumela wokufakwayo.
- <div class = "kahle" >
- ...
- </div>
Lawula ama-padding namakhona ayindilinga ngamakilasi amabili okushintsha ozikhethela wona.
- <div class = "kuhle-kuhle" >
- ...
- </div>
- <div class = "kahle-small" >
- ...
- </div>
Sebenzisa isithonjana sokuvala esijwayelekile ukuze uchithe okuqukethwe okufana namamodeli nezixwayiso.
- <inkinobho yekilasi = "vala" > &izikhathi; </inkinobho>
Amadivayisi we-iOS adinga href="#"
ukuchofoza imicimbi uma ungathanda ukusebenzisa ihange.
- <a class = "close" href = "#" > &izikhathi; </a>
Amakilasi alula, agxilile okubonisa okuncane noma ama-tweaks wokuziphatha.
Ntanta i-elementi kwesokunxele
- class = "donsa-kwesokunxele"
- . donsa - kwesokunxele {
- ntanta : kwesobunxele ;
- }
Gcoba i-elementi kwesokudla
- class = "donsa-kwesokudla"
- . donsa - kwesokudla {
- ukuntanta : kwesokudla ;
- }
Shintsha umbala we-elementi ube#999
- class = "thulisiwe"
- . uthulisiwe {
- umbala : #999;
- }
Sula float
kunoma iyiphi i-elementi
- class = "clearfix"
- . clearfix {
- sondeza : 1 ; _
- &: ngaphambili ,
- &: ngemva {
- isibonisi : ithebula ;
- okuqukethwe : "" ;
- }
- &: ngemva {
- cacile : kokubili ;
- }
- }