Vipengee vingi vinavyoweza kutumika tena vilivyoundwa ili kutoa urambazaji, arifa, popovers, na zaidi.
Menyu inayoweza kugeuzwa, ya muktadha ya kuonyesha orodha za viungo. Imeingiliana na menyu kunjuzi ya JavaScript .
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dropdownMenu" >
- <li><a tabindex = "-1" href = "#" > Kitendo </a></li>
- <li><a tabindex = "-1" href = "#" > Kitendo kingine </a></li>
- <li><a tabindex = "-1" href = "#" > Kitu kingine hapa </a></li>
- <li class = "divider" ></li>
- <li><a tabindex = "-1" href = "#" > Kiungo kilichotenganishwa </a></li>
- </ul>
Ukiangalia menyu kunjuzi tu, hii ndio HTML inayohitajika. Unahitaji kukunja kianzio cha menyu kunjuzi na menyu kunjuzi ndani ya .dropdown
, au kipengele kingine kinachotangaza position: relative;
. Kisha tu kuunda menyu.
- <div class = "dropdown" >
- <!-- Unganisha au kitufe cha kugeuza menyu kunjuzi -->
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel" >
- <li><a tabindex = "-1" href = "#" > Kitendo </a></li>
- <li><a tabindex = "-1" href = "#" > Kitendo kingine </a></li>
- <li><a tabindex = "-1" href = "#" > Kitu kingine hapa </a></li>
- <li class = "divider" ></li>
- <li><a tabindex = "-1" href = "#" > Kiungo kilichotenganishwa </a></li>
- </ul>
- </ div>
Pangilia menyu upande wa kulia na uongeze ni pamoja na viwango vya ziada vya menyu kunjuzi.
Ongeza .pull-right
kwenye a .dropdown-menu
panga menyu kunjuzi.
- <ul class = "dropdown-menu pull-right" role = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
Ongeza .disabled
kwenye <li>
menyu kunjuzi ili kuzima kiungo.
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dropdownMenu" >
- <li><a tabindex = "-1" href = "#" > Kiungo cha kawaida </a></li>
- <li class = "disabled" ><a tabindex = "-1" href = "#" > Kiungo kilichozimwa </a></li>
- <li><a tabindex = "-1" href = "#" > Kiungo kingine </a></li>
- </ul>
Ongeza kiwango cha ziada cha menyu kunjuzi, zinazoonekana kwenye kielelezo kama zile za OS X, pamoja na nyongeza rahisi za alamisho. Ongeza .dropdown-submenu
kwa yoyote li
katika menyu kunjuzi iliyopo ili uweke mtindo wa kiotomatiki.
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel" >
- ...
- <li class = "dropdown-submenu" >
- <a tabindex = "-1" href = "#" > Chaguo zaidi </a>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </li>
- </ul>
Uandikaji rahisi uliochochewa na Rdio, mzuri kwa programu na matokeo ya utafutaji. Kizuizi kikubwa ni ngumu kukosa, kinaweza kuongezwa kwa urahisi, na hutoa maeneo makubwa ya kubofya.
- <div class = "pagination" >
- <ul>
- <li><a href = "#" > Iliyotangulia </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 = "#" > Inayofuata </a></li>
- </ul>
- </ div>
Viungo vinaweza kubinafsishwa kwa hali tofauti. Tumia .disabled
kwa viungo visivyobofya na .active
kuashiria ukurasa wa sasa.
- <div class = "pagination" >
- <ul>
- <li class = "disabled" ><a href = "#" > « </a></li>
- <li class = "active" ><a href = "#" > 1 </a></li>
- ...
- </ul>
- </ div>
Unaweza kubadilisha kwa hiari viunga vinavyotumika au vilivyozimwa kwa vipenyo ili kuondoa utendakazi wa kubofya huku ukihifadhi mitindo iliyokusudiwa.
- <div class = "pagination" >
- <ul>
- <li class = "walemavu" ><span> « </span></li>
- <li class = "active" ><span> 1 </span></li>
- ...
- </ul>
- </ div>
Je, ungependa kutengeneza kurasa kubwa au ndogo zaidi? Ongeza .pagination-large
, .pagination-small
, au .pagination-mini
kwa saizi za ziada.
- <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>
Ongeza mojawapo ya madarasa mawili ya hiari ili kubadilisha upatanishi wa viungo vya upagino: .pagination-centered
na .pagination-right
.
- <div class = "pagination-centered" >
- ...
- </ div>
- <div class = "pagination-right" >
- ...
- </ div>
Viungo vya haraka vilivyotangulia na vifuatavyo vya utekelezaji rahisi wa uwekaji alama na mitindo nyepesi. Ni nzuri kwa tovuti rahisi kama blogu au majarida.
Kwa chaguo-msingi, paja huweka viungo.
- <ul class = "pager" >
- <li><a href = "#" > Iliyotangulia </a></li>
- <li><a href = "#" > Inayofuata </a></li>
- </ul>
Vinginevyo, unaweza kusawazisha kila kiunga kwa pande:
- <ul class = "pager" >
- <li class = "previous" >
- <a href = "#" > ← Mzee </a>
- </li>
- <li class = "next" >
- <a href = "#" > Mpya zaidi → </a>
- </li>
- </ul>
Viungo vya Pager pia hutumia .disabled
darasa la matumizi ya jumla kutoka kwa pagination.
- <ul class = "pager" >
- <li class = "previous disabled" >
- <a href = "#" > ← Mzee </a>
- </li>
- ...
- </ul>
Lebo | Alama |
---|---|
Chaguomsingi | <span class="label">Default</span> |
Mafanikio | <span class="label label-success">Success</span> |
Onyo | <span class="label label-warning">Warning</span> |
Muhimu | <span class="label label-important">Important</span> |
Habari | <span class="label label-info">Info</span> |
Inverse | <span class="label label-inverse">Inverse</span> |
Jina | Mfano | Alama |
---|---|---|
Chaguomsingi | 1 | <span class="badge">1</span> |
Mafanikio | 2 | <span class="badge badge-success">2</span> |
Onyo | 4 | <span class="badge badge-warning">4</span> |
Muhimu | 6 | <span class="badge badge-important">6</span> |
Habari | 8 | <span class="badge badge-info">8</span> |
Inverse | 10 | <span class="badge badge-inverse">10</span> |
Kwa utekelezaji rahisi, lebo na beji zitaanguka (kupitia kiteuzi cha CSS :empty
) wakati hakuna maudhui ndani.
Sehemu nyepesi, inayonyumbulika ili kuonyesha maudhui muhimu kwenye tovuti yako. Inafanya kazi vizuri kwenye tovuti za uuzaji na maudhui mazito.
Hiki ni kitengo rahisi cha shujaa, kijenzi rahisi cha mtindo wa jumbotron cha kutoa umakini wa ziada kwa maudhui au maelezo yaliyoangaziwa.
- <div class = "hero-unit" >
- <h1> Kichwa </ h1>
- <p> Mstari wa tagi </p>
- <p>
- <a class = "btn btn-primary btn-large" >
- Jifunze zaidi
- </a>
- </ p>
- </ div>
Gamba rahisi la h1
kuweka nafasi ipasavyo na kuweka sehemu za yaliyomo kwenye ukurasa. Inaweza kutumia h1
chaguo-msingi small
, kipengele pamoja na vipengele vingine vingi (na mitindo ya ziada).
- <div class = "page-header" >
- <h1> Mfano wa kichwa cha ukurasa <small> Matini ndogo ya kichwa </small></h1>
- </ div>
Kwa chaguo-msingi, vijipicha vya Bootstrap vimeundwa ili kuonyesha picha zilizounganishwa na alama ndogo zinazohitajika.
Ukiwa na lebo ya ziada, inawezekana kuongeza aina yoyote ya maudhui ya HTML kama vile vichwa, aya, au vitufe kwenye vijipicha.
Vijipicha (hapo awali .media-grid
hadi v1.4) ni vyema kwa gridi za picha au video, matokeo ya utafutaji wa picha, bidhaa za rejareja, portfolios, na mengi zaidi. Wanaweza kuwa viungo au maudhui tuli.
Alama ya kijipicha ni rahisi—a ul
yenye idadi yoyote ya li
vipengele ndiyo tu inayohitajika. Pia ni rahisi kunyumbulika, ikiruhusu aina yoyote ya maudhui yenye alamisho kidogo zaidi ili kufunga maudhui yako.
Hatimaye, sehemu ya vijipicha hutumia aina zilizopo za mfumo wa gridi—kama .span2
au .span3
—kwa udhibiti wa vipimo vya kijipicha.
Kama ilivyotajwa hapo awali, alama inayohitajika ya vijipicha ni nyepesi na moja kwa moja. Hapa angalia usanidi chaguo-msingi wa picha zilizounganishwa :
- <ul class = "thumbnails" >
- <li class = "span4" >
- <a href = "#" class = "kijipicha" >
- <img data-src = "holder.js/300x200" alt = "" >
- </a>
- </li>
- ...
- </ul>
Kwa maudhui maalum ya HTML katika vijipicha, alama hubadilika kidogo. Ili kuruhusu maudhui ya kiwango cha kuzuia mahali popote, tunabadilishana <a>
kama <div>
vile:
- <ul class = "thumbnails" >
- <li class = "span4" >
- <div class = "thumbnail" >
- <img data-src = "holder.js/300x200" alt = "" >
- <h3> Lebo ya kijipicha </h3>
- <p> Manukuu ya kijipicha... </p>
- </ div>
- </li>
- ...
- </ul>
Chunguza chaguo zako zote ukitumia aina mbalimbali za gridi zinazopatikana kwako. Unaweza pia kuchanganya na kuchanganya ukubwa tofauti.
Funga maandishi yoyote na kitufe cha hiari cha kuondoa .alert
kwa ujumbe wa tahadhari ya msingi.
- <div class = "alert" >
- <button type = "button" class = "close" data-dismiss = "alert" > × </kifungo>
- <strong> Onyo! </strong> Bora jiangalie mwenyewe, huonekani kuwa mzuri sana.
- </ div>
Vivinjari vya Safari ya Simu na Mobile Opera, pamoja na data-dismiss="alert"
sifa, vinahitaji ili kuondoa href="#"
arifa unapotumia <a>
lebo.
- <a href = "#" class = "close" data-dismiss = "alert" > × </a>
Vinginevyo, unaweza kutumia <button>
kipengele chenye sifa ya data, ambacho tumechagua kufanya kwa hati zetu. Unapotumia <button>
, ni lazima ujumuishe type="button"
au fomu zako zisiwasilishe.
- <button type = "button" class = "close" data-dismiss = "alert" > × </kifungo>
Tumia programu- jalizi ya arifa za jQuery kwa uondoaji wa arifa haraka na rahisi.
Kwa ujumbe mrefu, ongeza pedi juu na chini ya kanga ya tahadhari kwa kuongeza .alert-block
.
Bora jiangalie mwenyewe, huonekani kuwa mzuri sana. Nulla vitae elit libero, pharetra augue. Karibu commodo cursus magna, vel scelerisque nisl consectetur et.
- <div class = "alert alert-block" >
- <button type = "button" class = "close" data-dismiss = "alert" > × </kifungo>
- <h4> Onyo! </ h4>
- Bora ujichunguze, wewe si...
- </ div>
Ongeza madarasa ya hiari ili kubadilisha maana ya arifa.
- <div class = "alert alert-error" >
- ...
- </ div>
- <div class = "alert alert-success" >
- ...
- </ div>
- <div class = "tahadhari ya taarifa" >
- ...
- </ div>
Upau chaguo-msingi wa maendeleo na upinde rangi wima.
- <div class = "progress" >
- <div class = "bar" style = " width : 60 %; " ></div>
- </ div>
Hutumia upinde rangi kuunda athari yenye milia. Haipatikani katika IE7-8.
- <div class = "progress progress-striped" >
- <div class = "bar" style = " width : 20 %; " ></div>
- </ div>
Ongeza .active
kwa .progress-striped
kuhuisha milia kulia kwenda kushoto. Haipatikani katika matoleo yote ya IE.
- <div class = "progress progress-striped active" >
- <div class = "bar" style = " width : 40 %; " ></div>
- </ div>
Weka pau nyingi kwenye kitu kimoja .progress
ili kuziweka.
- <div class = "progress" >
- <div class = "bar-success" style = " upana : 35 %; " ></div>
- <div class = "bar-warning" style = " upana : 20 %; " ></div>
- <div class = "bar-danger" style = " width : 10 %; " ></div>
- </ div>
Pau za maendeleo hutumia baadhi ya vitufe sawa na madarasa ya tahadhari kwa mitindo thabiti.
- <div class = "progress progress-info" >
- <div class = "bar" style = " width : 20 % " ></div>
- </ div>
- <div class = "progress progress-success" >
- <div class = "bar" style = " width : 40 % " ></div>
- </ div>
- <div class = "onyo la maendeleo" >
- <div class = "bar" style = " width : 60 % " ></div>
- </ div>
- <div class = "progress progress-hatari" >
- <div class = "bar" style = " width : 80 % " ></div>
- </ div>
Sawa na rangi dhabiti, tuna pau tofauti za maendeleo zenye mistari.
- <div class = "progress progress-info progress-striped" >
- <div class = "bar" style = " width : 20 % " ></div>
- </ div>
- <div class = "progress progress-success progress-striped" >
- <div class = "bar" style = " width : 40 % " ></div>
- </ div>
- <div class = "maendeleo-onyo la maendeleo-yamepunguzwa" >
- <div class = "bar" style = " width : 60 % " ></div>
- </ div>
- <div class = "progress progress-danger progress-striped" >
- <div class = "bar" style = " width : 80 % " ></div>
- </ div>
Pau za maendeleo hutumia gradient za CSS3, mipito, na uhuishaji kufikia athari zao zote. Vipengele hivi havitumiki katika IE7-9 au matoleo ya awali ya Firefox.
Matoleo ya mapema zaidi ya Internet Explorer 10 na Opera 12 hayatumii uhuishaji.
Mitindo ya vitu dhahania ya kuunda aina mbalimbali za vipengele (kama maoni ya blogu, Tweets, n.k) ambazo zinaangazia picha iliyopangwa kushoto au kulia pamoja na maudhui ya maandishi.
Midia chaguo-msingi huruhusu kuelea kitu cha midia (picha, video, sauti) upande wa kushoto au kulia wa kizuizi cha maudhui.
- <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" > Kichwa cha habari </h4>
- ...
- <!-- Nested media object -->
- <div class = "media" >
- ...
- </ div>
- </ div>
- </ div>
Ukiwa na lebo ya ziada, unaweza kutumia maudhui ya ndani ya orodha (yanafaa kwa mazungumzo ya maoni au orodha za makala).
Cras sit amet nibh libero, katika gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum katika vulputate saa, 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 class = "media-heading" > Kichwa cha habari </h4>
- ...
- <!-- Nested media object -->
- <div class = "media" >
- ...
- </ div>
- </ div>
- </li>
- </ul>
Tumia kisima kama athari rahisi kwenye kipengele ili kukipa athari ya kuingiza.
- <div class = "vizuri" >
- ...
- </ div>
Dhibiti pedi na pembe zilizo na mviringo kwa madarasa mawili ya hiari ya kurekebisha.
- <div class = "well-large" >
- ...
- </ div>
- <div class = "well-small" >
- ...
- </ div>
Tumia aikoni ya jumla ya kufunga kwa kuondoa maudhui kama vile miundo na arifa.
- <button class = "close" > × </kifungo>
Vifaa vya iOS vinahitaji href="#"
kwa matukio ya kubofya ikiwa ungependa kutumia nanga.
- <a class = "close" href = "#" > × </a>
Madarasa rahisi, yaliyolengwa kwa maonyesho madogo au marekebisho ya tabia.
Elekeza kipengele kushoto
- darasa = "vuta-kushoto"
- . vuta - kushoto {
- kuelea : kushoto ;
- }
Elekeza kipengele kulia
- darasa = "vuta kulia"
- . vuta - kulia {
- kuelea : kulia ;
- }
Badilisha rangi ya kipengele kuwa#999
- darasa = "umezimwa"
- . imenyamazishwa {
- rangi : #999;
- }
Futa float
kwenye kipengele chochote
- darasa = "clearfix"
- . clearfix {
- * kuza : 1 ;
- &: kabla ,
- &: baada ya {
- onyesha : meza ;
- maudhui : "" ;
- }
- &: baada ya {
- wazi : zote mbili ;
- }
- }