Yawancin abubuwan da aka sake amfani da su da aka gina don samar da kewayawa, faɗakarwa, popovers, da ƙari.
Mai iya canzawa, menu na mahallin don nuna jerin hanyoyin haɗin gwiwa. An yi hulɗa tare da zazzage kayan aikin JavaScript .
- <ul class = "sauke-menu" rawar = "menu" aria-labelledby = "dropdownMenu" >
- <li><a tabindex = "-1" href = "#" > Aiki </a></li>
- <li><a tabindex = "-1" href = "#" > Wani aiki </a></li>
- <li><a tabindex = "-1" href = "#" > Wani abu kuma a nan </a></li>
- <li class = "mai rarrabawa" </li>
- <li><a tabindex = "-1" href = "#" > Rabuwar hanyar haɗin gwiwa </a></li>
- </ul>
Duba kawai menu na zazzagewa, ga HTML ɗin da ake buƙata. Kuna buƙatar kunsa maɓallin zazzagewa da menu na zazzagewa a cikin .dropdown
, ko wani ɓangaren da ke bayyana position: relative;
. Sa'an nan kawai ƙirƙirar menu.
- <div class = "saukarwa" >
- <!-- Hanyar haɗi ko maɓalli don kunna zazzagewa -->
- <ul class = "zaɓi-menu" rawar = "menu" aria-labeledby = "dLabel" >
- <li><a tabindex = "-1" href = "#" > Aiki </a></li>
- <li><a tabindex = "-1" href = "#" > Wani aiki </a></li>
- <li><a tabindex = "-1" href = "#" > Wani abu kuma a nan </a></li>
- <li class = "mai rarrabawa" </li>
- <li><a tabindex = "-1" href = "#" > Rabuwar hanyar haɗin gwiwa </a></li>
- </ul>
- </div>
Daidaita menus zuwa dama kuma ƙara sun haɗa da ƙarin matakan zaɓuka.
Ƙara .pull-right
zuwa .dropdown-menu
dama a daidaita menu na zazzagewa.
- <ul class = "zaɓi-menu pull-right" rawar = "menu" aria-labeledby = "dLabel" >
- ...
- </ul>
Ƙara .disabled
zuwa <li>
cikin zazzagewar don kashe hanyar haɗin.
- <ul class = "sauke-menu" rawar = "menu" aria-labelledby = "dropdownMenu" >
- <li><a tabindex = "-1" href = "#" > Haɗin kai na yau da kullun </a></li>
- <li class = "disabled" ><a tabindex = "-1" href = "#" > An kashe hanyar haɗin gwiwa </a></li>
- <li><a tabindex = "-1" href = "#" > Wani hanyar haɗi </a></li>
- </ul>
Ƙara ƙarin matakin menus na zazzagewa, yana bayyana akan shawagi kamar na OS X, tare da wasu ƙarin ƙari mai sauƙi. Ƙara .dropdown-submenu
zuwa kowane li
a cikin jerin zaɓuka na yanzu don salo ta atomatik.
- <ul class = "zaɓi-menu" rawar = "menu" aria-labeledby = "dLabel" >
- ...
- <li class = "zaɓi-submenu" >
- <a tabindex = "-1" href = "#" > Ƙarin zaɓuɓɓuka </a>
- <ul class = "zazzage-menu" >
- ...
- </ul>
- </li>
- </ul>
Sauƙaƙan rubutun da aka yi wahayi daga Rdio, mai girma don ƙa'idodi da sakamakon bincike. Babban toshe yana da wuya a rasa, sauƙin daidaitawa, kuma yana ba da manyan wuraren dannawa.
- <div class = "pagination" >
- <ul>
- <li><a href = "#" > Prev </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 = "#" > Gaba </a></li>
- </ul>
- </div>
Ana iya daidaita hanyoyin haɗin gwiwa don yanayi daban-daban. Yi amfani .disabled
da hanyoyin haɗin da ba za a iya dannawa ba kuma .active
don nuna shafin na yanzu.
- <div class = "pagination" >
- <ul>
- <li class = "disabled" ><a href = "#" > « </li>
- <li class = "active" ><a href = "#" > 1 </a></li>
- ...
- </ul>
- </div>
Kuna iya da zaɓin musanya anka mai aiki ko naƙasasshe don tazara don cire ayyukan dannawa yayin riƙe da salon da aka yi niyya.
- <div class = "pagination" >
- <ul>
- <li class = "an kashe" ><span> « </span></li>
- <li class = "active" ><span> 1 </span></li>
- ...
- </ul>
- </div>
Zaki fi girma ko ƙarami? Ƙara .pagination-large
, .pagination-small
, ko .pagination-mini
don ƙarin girma.
- <div class = "pagination pagination-large" >
- <ul>
- ...
- </ul>
- </div>
- <div class = "pagination" >
- <ul>
- ...
- </ul>
- </div>
- <div class = "pagination pagination-small" >
- <ul>
- ...
- </ul>
- </div>
- <div class = "pagination pagination-mini" >
- <ul>
- ...
- </ul>
- </div>
Ƙara ɗaya daga cikin azuzuwan zaɓi biyu don canza daidaita hanyoyin haɗin yanar gizo: .pagination-centered
da .pagination-right
.
- <div class = "pagination pagination-centered" >
- ...
- </div>
- <div class = "pagination pagination-right" >
- ...
- </div>
Hanyoyi masu sauri na baya da na gaba don aiwatar da fage mai sauƙi tare da alamar haske da salo. Yana da kyau ga shafuka masu sauƙi kamar blogs ko mujallu.
Ta hanyar tsoho, shafin yanar gizon yana haɗin haɗin kai.
- <ul class = "pager" >
- <li><a href = "#" > Gaba </a> </li>
- <li><a href = "#" > Gaba </a></li>
- </ul>
A madadin, zaku iya daidaita kowace hanyar haɗin gwiwa zuwa ɓangarorin:
- <ul class = "pager" >
- <li class = "na baya" >
- <a href = "#" > ← Tsoho </a>
- </li>
- <li class = "na gaba" >
- <a href = "#" > Sabo → </a>
- </li>
- </ul>
Hanyoyin haɗin yanar gizon Pager kuma suna amfani da .disabled
ajin mai amfani na gaba ɗaya daga rubutun.
- <ul class = "pager" >
- <li class = "an kashe a baya" >
- <a href = "#" > ← Tsoho </a>
- </li>
- ...
- </ul>
Lakabi | Alamar alama |
---|---|
Tsohuwar | <span class="label">Default</span> |
Nasara | <span class="label label-success">Success</span> |
Gargadi | <span class="label label-warning">Warning</span> |
Muhimmanci | <span class="label label-important">Important</span> |
Bayani | <span class="label label-info">Info</span> |
Juyawa | <span class="label label-inverse">Inverse</span> |
Suna | Misali | Alamar alama |
---|---|---|
Tsohuwar | 1 | <span class="badge">1</span> |
Nasara | 2 | <span class="badge badge-success">2</span> |
Gargadi | 4 | <span class="badge badge-warning">4</span> |
Muhimmanci | 6 | <span class="badge badge-important">6</span> |
Bayani | 8 | <span class="badge badge-info">8</span> |
Juyawa | 10 | <span class="badge badge-inverse">10</span> |
Don aiwatarwa cikin sauƙi, alamomi da baji za su ruguje kawai (ta hanyar :empty
zaɓin CSS) lokacin da babu abun ciki a ciki.
Abu mai sauƙi, sassauƙa don nuna mahimman abun ciki akan rukunin yanar gizonku. Yana aiki da kyau akan tallace-tallace da shafuka masu nauyi.
Wannan rukunin jarumai ne mai sauƙi, sassauƙan salon jumbotron don kiran ƙarin hankali ga fitaccen abun ciki ko bayanai.
- <div class = "jarumin jarumta" >
- <h1> Jagora </h1>
- <p> Tagline </p>
- <p>
- <a class = "btn btn-primary btn-large" >
- Ƙara koyo
- </a>
- </p>
- </div>
Sauƙaƙan harsashi don h1
fitar da sarari yadda ya kamata da yanki sassan abun ciki a shafi. Yana iya amfani da h1
tsohowar small
, element da sauran sauran abubuwan haɗin gwiwa (tare da ƙarin salo).
- <div class = "shafi-header" >
- <h1> Misalin taken shafi <karamin> Rubutu don kai </small></h1>
- </div>
Ta hanyar tsoho, an tsara thumbnails na Bootstrap don nuna hotunan da aka haɗe tare da ƙarancin alamar da ake buƙata.
Tare da ɗan ƙarin alamar alama, yana yiwuwa a ƙara kowane nau'in abun ciki na HTML kamar kanun labarai, sakin layi, ko maɓalli a cikin ƙananan hotuna.
Tambayoyi (a baya .media-grid
har zuwa v1.4) suna da kyau don grid na hotuna ko bidiyo, sakamakon binciken hoto, samfuran tallace-tallace, fayiloli, da ƙari mai yawa. Suna iya zama mahaɗi ko abun ciki na tsaye.
Alamar thumbnail abu ne mai sauƙi - ul
tare da kowane adadin li
abubuwa shine duk abin da ake buƙata. Hakanan yana da sauƙin sassauƙa, yana ba da damar kowane nau'in abun ciki tare da ɗan ƙara alama don naɗe abubuwan ku.
A ƙarshe, ɓangaren takaitaccen siffofi yana amfani da azuzuwan tsarin grid-kamar .span2
ko.span3
-don sarrafa girman ɗan yatsa.
Kamar yadda aka ambata a baya, alamar da ake buƙata don thumbnails yana da haske kuma mai sauƙi. Anan kalli saitunan tsoho don hotuna masu alaƙa :
- <ul class = "thumbnails" >
- <li class = "span4" >
- <a href = "#" class = "thumbnail" >
- <img data-src = "mai riƙe.js/300x200" alt = "" >
- </a>
- </li>
- ...
- </ul>
Don abun ciki na HTML na al'ada a cikin ƙananan hotuna, alamar tana canzawa kaɗan. Don ba da izinin toshe abun ciki a ko'ina, muna musanya shi <a>
don <div>
kamar haka:
- <ul class = "thumbnails" >
- <li class = "span4" >
- <div class = "thumbnail" >
- <img data-src = "mai riƙe.js/300x200" alt = "" >
- <h3> Alamar ɗan yatsa </h3>
- <p> Takardun yatsa... </p>
- </div>
- </li>
- ...
- </ul>
Bincika duk zaɓuɓɓukanku tare da nau'ikan grid iri-iri da ke akwai a gare ku. Hakanan zaka iya haɗawa da daidaita girma dabam dabam.
Rufe kowane rubutu da maɓallin korar zaɓi .alert
don ainihin saƙon faɗakarwar faɗakarwa.
- <div class = "jijjiga" >
- < nau'in maballin = "button" class = "rufe" data-dismiss = "jijjiga" > × </button>
- <strong> Gargadi! Mafi kyawun duba yo kai, ba ka da kyau sosai.
- </div>
Mobile Safari da Mobile Opera browsers, ban da data-dismiss="alert"
sifa, suna buƙatar href="#"
korar faɗakarwa yayin amfani da <a>
alamar.
- <a href = "#" class = "kusa" data-dismiss = "jijjiga" > × </a>
A madadin, zaku iya amfani da wani <button>
abu mai sifa na bayanai, wanda muka zaɓi yi don takaddun mu. Lokacin amfani da <button>
, dole ne ku haɗa type="button"
ko fom ɗin ku bazai ƙaddamar ba.
- < nau'in maballin = "button" class = "rufe" data-dismiss = "jijjiga" > × </button>
Yi amfani da kayan aikin jQuery faɗakarwa don saurin korar faɗakarwa.
Don tsayin saƙonni, ƙara madaidaicin saman da kasan abin rufewar faɗakarwa ta ƙara .alert-block
.
Mafi kyawun duba kanku, ba ku da kyau sosai. Nulla vitae elit libero, a pharetra augue. Abubuwan da suka dace da cursus magna, velsselerisque nisl consectetur et.
- <div class = "jijjiga-block" >
- < nau'in maballin = "button" class = "rufe" data-dismiss = "jijjiga" > × </button>
- <h4> Gargadi! </h4> ku
- Mafi kyawun bincika kan ku, ba ku ...
- </div>
Ƙara azuzuwan zaɓi don canza ma'anar faɗakarwa.
- <div class = "kuskuren faɗakarwa" >
- ...
- </div>
- <div class = "jijjiga faɗakarwa-nasara" >
- ...
- </div>
- <div class = "jijjiga-info" >
- ...
- </div>
Tsohuwar mashaya ci gaba tare da gradient a tsaye.
- <div class = "ci gaba" >
- <div class = "bar" style = " nisa : 60 %; " ></ div>
- </div>
Yana amfani da gradient don ƙirƙirar tasirin tsiri. Babu a cikin IE7-8.
- <div class = "ci gaban ci gaba-raguwa" >
- <div class = "bar" style = " nisa : 20 %; " ></ div>
- </div>
Ƙara .active
zuwa .progress-striped
don raya ratsi dama zuwa hagu. Babu samuwa a cikin duk nau'ikan IE.
- <div class = "ci gaba-gaba mai aiki" >
- <div class = "bar" style = " nisa : 40 %; " ></ div>
- </div>
Sanya sanduna da yawa cikin guda ɗaya .progress
don tara su.
- <div class = "ci gaba" >
- <div class = "bar bar-success" style = " nisa : 35 %; " > </div>
- <div class = "bar-gargadi" style = " nisa : 20 %; " > </div>
- <div class = "bar-danger" style = " nisa : 10 %; " > </div>
- </div>
Sandunan ci gaba suna amfani da wasu maɓalli iri ɗaya da azuzuwan faɗakarwa don daidaitattun salo.
- <div class = "ci gaban-info" >
- <div class = "bar" style = " nisa : 20 % " ></ div>
- </div>
- <div class = "ci gaban ci gaba-nasara" >
- <div class = "bar" style = " nisa : 40 % " ></ div>
- </div>
- <div class = "gargadin ci gaba-gaba" >
- <div class = "bar" style = " nisa : 60 % " ></ div>
- </div>
- <div class = "progress progress-danger" >
- <div class = "bar" style = " nisa : 80 % " ></ div>
- </div>
Kama da m launuka, muna da bambance bambancen sanduna ci gaba.
- <div class = "ci gaban cigaba-info progress-striped" >
- <div class = "bar" style = " nisa : 20 % " ></ div>
- </div>
- <div class = "ci gaba-ci gaba-nasara-ci gaba" >
- <div class = "bar" style = " nisa : 40 % " ></ div>
- </div>
- <div class = "ci gaba-gaba-gargadi-ci gaba-raguwa" >
- <div class = "bar" style = " nisa : 60 % " ></ div>
- </div>
- <div class = "ci gaban ci gaba-danger progress-striped" >
- <div class = "bar" style = " nisa : 80 % " ></ div>
- </div>
Sandunan ci gaba suna amfani da gradients CSS3, canji, da rayarwa don cimma duk tasirin su. Ba a tallafawa waɗannan fasalulluka a cikin IE7-9 ko tsofaffin nau'ikan Firefox.
Siffofin da suka wuce Internet Explorer 10 da Opera 12 ba sa goyan bayan rayarwa.
Salon abubuwa masu ƙima don gina nau'ikan abubuwa daban-daban (kamar sharhin blog, Tweets, da sauransu) waɗanda ke nuna hoton hagu ko dama tare da abun ciki na rubutu.
Tsoffin kafofin watsa labarai suna ba da damar yawo wani abu mai jarida (hotuna, bidiyo, sauti) zuwa hagu ko dama na toshewar abun ciki.
- <div class = "media" >
- <a class = "pull-left" href = "#" >
- <img class = "media-object" data-src = "mai riƙe.js/64x64" >
- </a>
- <div class = "media-body" >
- <h4 class = "kadin-watsa labarai" > Taken mai jarida </h4>
- ...
- <!-- Abun jarida mai gida -->
- <div class = "media" >
- ...
- </div>
- </div>
- </div>
Tare da ɗan ƙarin alamar alama, zaku iya amfani da kafofin watsa labarai a cikin jeri (mai amfani ga zaren sharhi ko jerin labarai).
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus sclerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
- <ul class = "jerin watsa labarai" >
- <li class = "media" >
- <a class = "pull-left" href = "#" >
- <img class = "media-object" data-src = "mai riƙe.js/64x64" >
- </a>
- <div class = "media-body" >
- <h4 class = "kadin-watsa labarai" > Taken mai jarida </h4>
- ...
- <!-- Abun jarida mai gida -->
- <div class = "media" >
- ...
- </div>
- </div>
- </li>
- </ul>
Yi amfani da rijiyar azaman tasiri mai sauƙi akan wani abu don ba shi tasirin sa.
- <div class = "lafiya" >
- ...
- </div>
Sarrafa madaidaicin sasanninta da sasanninta tare da azuzuwan gyare-gyare na zaɓi biyu.
- <div class = "babban girma" >
- ...
- </div>
- <div class = "da kyau-kanana" >
- ...
- </div>
Yi amfani da madaidaicin gunkin kusa don korar abun ciki kamar tsari da faɗakarwa.
- < class class = "kusa" > × </button>
Na'urorin iOS suna buƙatar href="#"
abubuwan da suka faru don danna idan kun fi son amfani da anga.
- <a class = "close" href = "#" > & lokuta; </a>
Sauƙaƙe, azuzuwan mayar da hankali don ƙaramin nuni ko tweaks ɗabi'a.
Taso kan wani kashi hagu
- class = "ja-hagu"
- . ja - hagu {
- yawo : hagu ;
- }
Taso kan wani abu dama
- class = "ja-dama"
- . ja - dama {
- yawo : dama ;
- }
Canja launin kashi zuwa#999
- class = "batattu"
- . shiru {
- launi : #999;
- }
Share float
kan kowane kashi
- class = "clearfix"
- . share gyara {
- * zuƙowa : 1 ;
- &: kafin ,
- &: bayan {
- nuni : tebur ;
- abun ciki : "" ;
- }
- &: bayan {
- bayyananne : biyu ;
- }
- }