Inqwaba yezingxenye ezisebenziseka kabusha zakhelwe ku-Bootstrap ukuze inikeze ukuzulazula, izexwayiso, ama-popovers, nokunye okuningi.
Ukwakheka kwamakhasi okunesitayela esilula kakhulu nokunesitayela esincane okukhuthazwe yi-Rdio, kulungele izinhlelo zokusebenza nemiphumela yosesho. Ibhulokhi enkulu kunzima ukuyigeja, ingakala kalula, futhi ihlinzeka ngezindawo ezinkulu zokuchofoza.
Izixhumanisi zingenziwa ngendlela oyifisayo futhi zisebenza ezimeni eziningi ngesigaba esifanele. .disabled
ngezixhumanisi ezingachofozwayo kanye .active
nekhasi lamanje.
Engeza noma yiliphi kwezigaba ezimbili ozikhethela ukuze uguqule ukuqondanisa kwezixhumanisi zamakhasi: .pagination-centered
kanye .pagination-right
.
Ingxenye yokubhala ezenzakalelayo iyavumelana nezimo futhi isebenza ngenani lokuhlukahluka.
Isongwe nge- <div>
, ukuqanjwa kumane nje kuyi- <ul>
.
- <div class = "pagination" >
- <ul>
- <li><a href = "#" > Okwedlule </a></li>
- <li class = "active" >
- <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 = "#" > Okulandelayo </a></li>
- </ul>
- </div>
Ingxenye yepheyija isethi yezixhumanisi zokusetshenziswa okulula kokwenza amaqebelengwane okunophawu olukhanyayo kanye nezitayela ezilula nakakhulu. Ilungele amasayithi alula njengamabhulogi noma omagazini.
Izixhumanisi zama-pager nazo zisebenzisa .disabled
isigaba esijwayelekile esivela ku-pagination.
Ngokuzenzakalela, izixhumanisi ze-pager.
- <ul class = "pager" >
- <li>
- <a href = "#" > Okwedlule </a>
- </li>
- <li>
- <a href = "#" > Okulandelayo </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> |
Amabheji amancane, izingxenye ezilula zokubonisa inkomba noma ukubala kohlobo oluthile. Avame ukutholakala kumaklayenti e-imeyili afana ne-Mail.app noma kuzinhlelo zokusebenza zeselula ukuze uthole izaziso zohlelo lokusebenza.
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> |
I-Bootstrap inikeza ingxenye engasindi, eguquguqukayo ebizwa ngokuthi iyunithi yeqhawe ukuze ibonise okuqukethwe kusayithi lakho. Isebenza kahle ekukhangiseni nakumasayithi anesisindo sokuqukethwe.
Gcwalisa okuqukethwe kwakho ngendlela div
efana nalena:
- <div class = "hero-unit" >
- <h1> Isihloko </h1>
- <p> Ulayini wethegi </p>
- <p>
- <a class = "btn btn-primary btn-large" >
- Funda kabanzi
- </a>
- </p>
- </div>
Leli iyunithi yeqhawe elilula, ingxenye elula yesitayela se-jumbotron yokubiza ukunaka okwengeziwe kokuqukethwe okufakiwe noma ulwazi.
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 </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—njengenoma— .span2
ukulawula .span3
ubukhulu bezithonjana.
Njengoba kushiwo ngaphambili, umaka odingekayo wezithonjana ulula futhi uqondile. Nakhu ukubheka ukusethwa okuzenzakalelayo kwezithombe ezixhunyiwe :
- <ul class = "izithonjana" >
- <li class = "span3" >
- <a href = "#" class = "isithonjana" >
- <img src = "https://placehold.it/260x180" 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 = "span3" >
- <div class = "isithonjana" >
- <img src = "https://placehold.it/260x180" alt = "" >
- <h5> Ilebula yesithonjana </h5>
- <p> Amazwibela esithonjana khona lapha... </p>
- </div>
- </li>
- ...
- </ul>
Nge-Bootstrap 2, senze isigaba sesisekelo saba lula: .alert
esikhundleni se- .alert-message
. Siphinde sehlise ubuncane bemakhaphu obudingekayo—cha <p>
iyadingeka ngokuzenzakalelayo, ngaphandle nje<div>
.
Ukuze uthole ingxenye ehlala isikhathi eside enekhodi encane, sisuse ukubukeka okuhlukanisayo kwezixwayiso zamabhulokhi, imilayezo eza namaphedi amaningi kanye nombhalo ngokuvamile owengeziwe. Ikilasi nalo selishintshile kwaba .alert-block
.
I-Bootstrap iza ne-plugin enhle ye-jQuery esekela imilayezo yesixwayiso, okwenza ukuyixosha ngokushesha futhi kube lula.
Goqa umlayezo wakho kanye nesithonjana ongasikhetha sokuvala ku-div ngekilasi elilula.
- <div class = "isaziso" >
- <button class = "close" data-dismiss = "alert" > × </button>
- <strong> Isexwayiso! I </strong> Zihlole kahle, awubukeki umuhle kakhulu.
- </div>
Amakhanda phezulu! Amadivayisi we-iOS adinga href="#"
ukuchithwa kwezixwayiso. Qiniseka ukuthi uyayifaka kanye nesibaluli sedatha sezithonjana zokuvala ihange. Kungenjalo, ungasebenzisa i- <button>
elementi enesibaluli sedatha, esikhethe ukuyenzela amadokhumenti ethu. Uma usebenzisa <button>
, kufanele ufake type="button"
noma amafomu akho angase angawahambisi.
Nweba kalula umlayezo ojwayelekile wesexwayiso ngamakilasi amabili ongawakhetha: .alert-block
ukuze uthole izilawuli eziningi zokupheda nombhalo kanye .alert-heading
nesihloko esifanayo.
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-block-block" >
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
- <h4 class = "alert-heading" > Isexwayiso! </h4>
- Okungcono uzihlole wena, awu...
- </div>
- <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 = "ibha"
- isitayela = " ububanzi : 60 %; " ></div>
- </div>
Isebenzisa i-gradient ukudala umphumela onemigqa (akukho IE).
- <div class = "progress progress-striped" >
- <div class = "ibha"
- isitayela = " ububanzi : 20 %; " ></div>
- </div>
Ithatha isibonelo esinemigqa bese isenza (akukho IE).
- <div class = "inqubekelaphambili enemigqa
- iyasebenza" >
- <div class = "ibha"
- isitayela = " ububanzi : 40 %; " ></div>
- </div>
Amabha okuqhubeka asebenzisa inkinobho efanayo namakilasi okuxwayisa ngezitayela ezingaguquki.
Ngokufana nemibala eqinile, sinemigoqo yenqubekelaphambili enemigqa ehlukahlukene.
Amabha okuqhubeka asebenzisa ukuguqulwa kwe-CSS3, ngakho-ke uma ulungisa ububanzi nge-javascript, izoshintsha usayizi ngokushelelayo.
Uma usebenzisa .active
ikilasi, .progress-striped
imigoqo yakho yokuqhubeka izophila imithende ukusuka kwesokunxele kuye kwesokudla.
Amabha wenqubekelaphambili asebenzisa ama-gradient e-CSS3, ukuguqulwa, nokugqwayiza ukuze kuzuzwe yonke imiphumela yakhona. Lezi zici azisekelwa kuzinguqulo ze-IE7-9 noma ezindala zeFirefox.
I-Opera ne-IE azisekeli ukugqwayiza ngalesi sikhathi.
Sebenzisa umthombo njengomphumela olula ku-elementi ukuze uyinikeze umphumela wokufakwayo.
- <div class = "kahle" >
- ...
- </div>
Sebenzisa isithonjana sokuvala esijwayelekile ukuze uchithe okuqukethwe okufana namamodeli nezixwayiso.
- <inkinobho yekilasi = "vala" > &izikhathi; </inkinobho>
Amadivayisi we-iOS adinga i- href="#" yokuchofoza imicimbi uma ukhetha ukusebenzisa ihange.
- <a class = "close" href = "#" > &izikhathi; </a>