An gina yawancin abubuwan sake amfani da su a cikin Bootstrap don samar da kewayawa, faɗakarwa, popovers, da ƙari mai yawa.
Mafi sauƙaƙa da ƙaramin salo mai salo wanda aka yi wahayi daga Rdio, mai girma ga ƙa'idodi da sakamakon bincike. Babban toshe yana da wuya a rasa, sauƙin daidaitawa, kuma yana ba da manyan wuraren dannawa.
Ana iya daidaita hanyoyin haɗin gwiwa kuma suna aiki a cikin yanayi da yawa tare da ajin da ya dace. .disabled
don hanyoyin haɗin da ba za a iya dannawa ba kuma .active
don shafin na yanzu.
Ƙara ko wanne daga cikin azuzuwan zaɓi biyu don canza daidaita hanyoyin haɗin yanar gizo: .pagination-centered
da .pagination-right
.
Sashin rubutun tsoho yana da sassauƙa kuma yana aiki cikin bambance-bambance masu yawa.
An nade a cikin wani <div>
, pagination ne kawai <ul>
.
- <div class = "pagination" >
- <ul>
- <li><a href = "#" > Prev </a></li>
- <li class = "aiki" >
- <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 = "#" > Gaba </a></li>
- </ul>
- </div>
Bangaren pager shine saitin hanyoyin haɗin gwiwa don aiwatar da fage mai sauƙi tare da alamar haske har ma da salo masu sauƙi. Yana da kyau ga shafuka masu sauƙi kamar blogs ko mujallu.
Hanyoyin haɗin yanar gizon Pager kuma suna amfani da .disabled
aji na gaba ɗaya daga pagination.
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>
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> |
Baji ƙanana ne, sassauƙan abubuwa don nuna alama ko ƙidaya wani nau'i. Ana yawan samun su a cikin abokan cinikin imel kamar Mail.app ko akan aikace-aikacen hannu don sanarwar turawa.
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> |
Bootstrap yana ba da sassauƙa mai sauƙi, sassauƙa da ake kira rukunin jaruma don nuna abun ciki akan rukunin yanar gizon ku. Yana aiki da kyau akan tallace-tallace da shafuka masu nauyi.
Kunna abubuwan ku div
kamar haka:
- <div class = "jarumin jarumta" >
- <h1> Jagora </h1>
- <p> Tagline </p>
- <p>
- <a class = "btn btn-primary btn-large" >
- Ƙara koyo
- </a>
- </p>
- </div>
Wannan rukunin jarumai ne mai sauƙi, sassauƙan salon jumbotron don kiran ƙarin hankali ga fitaccen abun ciki ko bayanai.
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 </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 thumbnails 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 = "span3" >
- <a href = "#" class = "thumbnail" >
- <img src = "https://placehold.it/260x180" 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 = "span3" >
- <div class = "thumbnail" >
- <img src = "https://placehold.it/260x180" alt = "" >
- <h5> Alamar ɗan yatsa </h5>
- <p> Taken thumbnail a nan... </p>
- </div>
- </li>
- ...
- </ul>
Tare da Bootstrap 2, mun sauƙaƙe ajin tushe: .alert
maimakon .alert-message
. Mun kuma rage mafi ƙarancin alamar da ake buƙata-babu <p>
ana buƙata ta tsohuwa, kawai na waje<div>
.
Don ƙarin abin ɗorewa tare da ƙasan lamba, mun cire bambance-bambancen neman faɗakarwar toshewa, saƙonnin da suka zo tare da ƙarin padding da yawanci ƙarin rubutu. Ajin kuma ya canza zuwa .alert-block
.
Bootstrap ya zo tare da babban kayan aikin jQuery wanda ke goyan bayan saƙonnin faɗakarwa, yin watsi da su cikin sauri da sauƙi.
Rufe saƙon ku da gunkin kusa na zaɓi a cikin div tare da aji mai sauƙi.
- <div class = "jijjiga" >
- < class class = "rufe" data-dismiss = "jijjiga" > × </button>
- <strong> Gargadi! Mafi kyawun duba yo kai, ba ka da kyau sosai.
- </div>
A kula! Na'urorin iOS suna buƙatar wani href="#"
don korar faɗakarwa. Tabbatar kun haɗa shi da sifa ta bayanai don gumakan anka kusa. A madadin, zaku iya amfani da wani <button>
abu mai sifa na bayanai, wanda muka zaɓi yi don takaddun mu. Lokacin amfani <button>
, dole ne ka haɗatype="button"
ko fom ɗin ku bazai ƙaddamar ba.
Sauƙaƙe miƙe daidaitaccen saƙon faɗakarwa tare da azuzuwan zaɓi guda biyu: .alert-block
don ƙarin padding da sarrafa rubutu da kuma .alert-heading
taken da ya dace.
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" >
- <a class = "close" data-dismiss = "jijjiga" href = "#" > × </a>
- <h4 class = "jigon faɗakarwa" > Gargadi! </h4> ku
- Mafi kyawun bincika kan ku, ba ku ...
- </div>
- <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 IE).
- <div class = "ci gaban ci gaba-raguwa" >
- <div class = "bar"
- style = " nisa : 20 %; " </div>
- </div>
Ɗauki misali mai laushi kuma yana raye shi (ba IE).
- <div class = "ci gaba-ci gaba
- aiki >
- <div class = "bar"
- style = " nisa : 40 %; " >> div>
- </div>
Sandunan ci gaba suna amfani da wasu maɓalli iri ɗaya da azuzuwan faɗakarwa don daidaitattun salo.
Kama da m launuka, muna da bambance bambancen sanduna ci gaba.
Sandunan ci gaba suna amfani da sauye-sauye na CSS3, don haka idan kun daidaita faɗin ta hanyar javascript, zai sake girma cikin sauƙi.
Idan kuna amfani da .active
ajin, .progress-striped
sandunan ci gaban ku za su rayar da ratsi daga hagu zuwa dama.
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.
Opera da IE basa goyan bayan rayarwa a wannan lokacin.
Yi amfani da rijiyar azaman tasiri mai sauƙi akan wani abu don ba shi tasirin sa.
- <div class = "lafiya" >
- ...
- </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 = "#" don danna abubuwan da suka faru idan kuna amfani da anga.
- <a class = "close" href = "#" > & lokuta; </a>