Ngaphezulu kwesikafula, izinto ezisisiseko zeHTML zenziwe ngesitayile kwaye ziphuculwe ngeeklasi ezandisiweyo ukunika inkangeleko entsha, engaguqukiyo kunye nokuziva.
Yonke igridi yokuchwetheza isekelwe kwiinguqu ezimbini ezincinci kwiinguqu zethu.ifayile engaphantsi: @baseFontSize
kunye @baseLineHeight
. Eyokuqala sisiseko sobungakanani befonti esetyenziswa kuyo yonke indawo kwaye eyesibini bubude bomgca wesiseko.
Sisebenzisa ezo ziguquguqukayo, kunye nezibalo ezithile, ukwenza imida, iipadi, kunye nobude bomgca walo lonke uhlobo lwethu nokunye.
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Yenza umhlathi ugqame ngokongeza .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
Isiqalelo | Ukusetyenziswa | Ukhetho |
---|---|---|
<strong> |
Ukugxininisa isiqwengana sesicatshulwa esibalulekileyo | Akukho nanye |
<em> |
Ukugxininisa i-snippet yesicatshulwa ngoxinzelelo | Akukho nanye |
<abbr> |
Usonga izifinyezo kunye nee-akhronimi ukubonisa inguqulelo eyandisiweyo kwi-hover | Bandakanya .initialism iklasi kwizifinyezo zoonobumba abakhulu. |
<address> |
Ngolwazi loqhagamshelwano ngokhokho walo okufutshane okanye wonke umsebenzi | Gcina ukufomatha ngokuphelisa yonke imigca nge<br> |
Fusce dapibus , tellus ac cursus commodo , tor mauris condimentum nibh , ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. I-Nulla vitae elit libero, i-pharetra augue.
Qaphela: Zive ukhululekile ukusebenzisa <b>
nakwi <i>
-HTML5, kodwa ukusetyenziswa kwazo kutshintshile kancinane. <b>
yenzelwe ukuqaqambisa amagama okanye amabinzana ngaphandle kokudlulisela ukubaluleka okongeziweyo ngelixa <i>
ubukhulu becala iselizwi, amagama obugcisa, njl.
Nantsi imizekelo emibini yendlela <address>
enokusetyenziswa ngayo ithegi:
Ushunqulelo olunophawu title
loyelelwano lunomda osezantsi onamachaphaza akhanyayo kunye nekhesa yoncedo kwi-hover. Oku kunika abasebenzisi isalathiso esongezelelweyo into eza kuboniswa kwi-hover.
Yongeza initialism
iklasi kwisifinyezo ukwandisa ukuhambelana kochwethezo ngokuyinika isayizi yombhalo omncinci kancinane.
I- HTML yeyona nto ilungileyo ukusukela kwisonka esisikiweyo.
Isishunqulelo segama loyelelwano sithi attr .
Isiqalelo | Ukusetyenziswa | Ukhetho |
---|---|---|
<blockquote> |
Isiqalelo seBhlokhi sokucaphula umxholo komnye umthombo | Yongeza .pull-left kunye .pull-right neeklasi kwiinketho ezidadayo |
<small> |
Into ekhethwayo yokongeza ucaphulo olujongene nomsebenzisi, umbhali onesihloko somsebenzi | Beka indawo <cite> malunga nesihloko okanye igama lomthombo |
Ukubandakanya i-blockquote, songela <blockquote>
malunga nayo nayiphi na i- HTML njengesicatshulwa. Kwiingcaphuno ezithe ngqo sicebisa ukuba a <p>
.
Bandakanya into oyikhethayo <small>
ukucaphula umthombo wakho kwaye uya kufumana i-dash em —
phambi kwayo ngeenjongo zesimbo.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante venenatis. </p>
- <encinci> Umntu odumileyo </ encinci>
- </blockquote>
Izicatshulwa zebhloko ezihlala zikhona zibhalwa ngolu hlobo:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante venenatis.
Umntu odumileyo kuMzimba womsebenzi
Ukudada ibhloko yakho ekunene, yongeza class="pull-right"
:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante venenatis.
Umntu odumileyo kuMzimba womsebenzi
<ul>
<ul class="unstyled">
<ol>
<dl>
<dl class="dl-horizontal">
Iintloko phezulu! Uluhlu lwenkcazo ethe tye luya kucutha amagama amade kakhulu ukuba angangena kuluhlu lwasekhohlo text-overflow
. Kwiindawo zokujonga ezimxinwa, ziya kutshintshela kuyilo olupakishweyo olungagqibekanga.
Songa iziqwengana zekhowudi nge <code>
.
- Umzekelo , < ikhowudi> icandelo </ ikhowudi > kufuneka isongwe njenge -inline .
Sebenzisa <pre>
kwimigca emininzi yekhowudi. Qiniseka ukuba ubaleka naziphi na izibiyeli ze-engile kwikhowudi yonikezelo olufanelekileyo.
<p>Isampuli yombhalo apha...</p>
- <pre>
- <p>Umzekelo wokubhaliweyo apha...</p>
- </pre>
Qaphela: Qinisekisa ukugcina ikhowudi ngaphakathi <pre>
kweethegi ngokusondeleyo ekhohlo kangangoko; iyakwenza zonke iithebhu.
Unokukhetha ukongeza .pre-scrollable
iklasi eya kuseka ubude bobude obuyi-350px kwaye ibonelele nge-y-axis scrollbar.
Thatha into efanayo <pre>
kwaye wongeze iindidi ezimbini ozikhethelayo ukulungiselela unikezelo oluphuculweyo.
- <p> Umzekelo wokubhaliweyo apha... </p>
- < iklasi yangaphambili = "prettyprint
- iilinenum" >
- <p>Umzekelo wokubhaliweyo apha...</p>
- </pre>
Khuphela i-google-code-prettify kwaye ujonge i-readme ukuze uyisebenzise.
Ithegi | Inkcazo |
---|---|
<table> |
Isiqalelo sokusonga sokubonisa idatha kwifomathi yetheyibhuli |
<thead> |
Isiqulatho sesiqalelo semigca yeheader yetheyibhile ( <tr> ) ukuleyibhelisha kwimiqolo yetafile |
<tbody> |
Isiqulatho sesiqalelo semiqolo yetafile ( <tr> ) kumzimba wetheyibhile |
<tr> |
Isiqulatho sesiqalelo seseti yeeseli zetafile ( <td> okanye <th> ) evela kumqolo omnye |
<td> |
Iseli yetafile ehlala ikho |
<th> |
Iseli yetafile ekhethekileyo yoluhlu (okanye umqolo, ngokuxhomekeke kububanzi kunye nokubekwa) iilebhile mazisetyenziswe ngaphakathi <thead> |
<caption> |
Inkcazo okanye isishwankathelo sezinto ezigcinwe yitheyibhile, ngakumbi ziluncedo kubafundi besikrini |
- <itheyibhile>
- <intloko>
- <tr>
- <th> … </th>
- <th> … </th>
- </tr>
- </ intloko>
- <iqela>
- <tr>
- <td> … </td>
- <td> … </td>
- </tr>
- </ umzimba>
- </ table>
Igama | Iklasi | Inkcazo |
---|---|---|
Ukuhlala kukho | Akukho nanye | Akukho zimbo, iikholamu nje kunye nemiqolo |
Isiseko | .table |
Kuphela imigca ethe tye phakathi kwemiqolo |
Umda | .table-bordered |
Ujikeleza iikona kwaye wongeza umda wangaphandle |
Zebra-umgca | .table-striped |
Yongeza umbala ongasemva ongwevu okhanyayo kwimiqolo engaqhelekanga (1, 3, 5, njalo njalo) |
Icutshiwe | .table-condensed |
Sika i-padding ethe nkqo kwisiqingatha, ukusuka kwi-8px ukuya kwi-4px, ngaphakathi kwayo yonke into td kunye th nezinto |
Iitheyibhile zibhalwa ngokuzenzekelayo kunye nemida embalwa kuphela ukuqinisekisa ukufundeka kunye nokugcina isakhiwo. Nge-2.0, .table
iklasi iyafuneka.
- < iklasi yetafile = "itafile" >
- …
- </ table>
# | Igama lokuqala | Ifani | Igama lomsebenzisi |
---|---|---|---|
1 | Phawula | Otto | @mdo |
2 | uYakobi | Thornton | @fat |
3 | Larry | intaka |
Fumana ubumnandi obuncinci ngeetafile zakho ngokongeza i-zebra-striping-yongeza nje .table-striped
iklasi.
Qaphela: Iitafile ezinemigca zisebenzisa :nth-child
umkhethi we-CSS kwaye ayifumaneki kwi-IE7-IE8.
- < iklasi yetafile = "itafile yetafile enemigca" >
- …
- </ table>
# | Igama lokuqala | Ifani | Igama lomsebenzisi |
---|---|---|---|
1 | Phawula | Otto | @mdo |
2 | uYakobi | Thornton | @fat |
3 | Larry | intaka |
Yongeza imida ejikeleze itafile yonke kunye neekona ezingqukuva ngeenjongo zobuhle.
- < iklasi yetafile = "itafile yetafile-umda" >
- …
- </ table>
# | Igama lokuqala | Ifani | Igama lomsebenzisi |
---|---|---|---|
1 | Phawula | Otto | @mdo |
Phawula | Otto | @getbootstrap | |
2 | uYakobi | Thornton | @fat |
3 | Larry intaka |
Yenza iitafile zakho zihlangane ngakumbi ngokongeza .table-condensed
iklasi ukusika i-padding cell cell kwisiqingatha (ukusuka kwi-8px ukuya kwi-4px).
- < iklasi yetafile = "itafile yetafile-icondensed" >
- …
- </ table>
# | Igama lokuqala | Ifani | Igama lomsebenzisi |
---|---|---|---|
1 | Phawula | Otto | @mdo |
2 | uYakobi | Thornton | @fat |
3 | Larry intaka |
Zive ukhululekile ukudibanisa naziphi na iiklasi zetafile ukuphumeza inkangeleko eyahlukileyo ngokusebenzisa naziphi na iiklasi ezikhoyo.
- < iklasi yetafile = "itafile yetafile enemigca yetafile-enomda wetafile-condensed" >
- ...
- </ table>
Igama eliphelele | |||
---|---|---|---|
# | Igama lokuqala | Ifani | Igama lomsebenzisi |
1 | Phawula | Otto | @mdo |
2 | uYakobi | Thornton | @fat |
3 | Larry intaka |
Elona candelo lilungileyo malunga neefom kwi-Bootstrap kukuba onke amagalelo akho kunye nolawulo lukhangeleka lukhulu kungakhathaliseki ukuba ulwakha njani kuphawu lwakho. Akukho HTML yangaphezulu ifunekayo, kodwa sibonelela ngeepatheni kwabo bayifunayo.
Uyilo oluntsonkothileyo luza neeklasi ezimfutshane kunye nezikhawulezayo zesitayile esilula kunye nokubopha iminyhadala, ke uyagqunywa kwinqanaba ngalinye.
I-Bootstrap iza nenkxaso kwiintlobo ezine zoyilo lwefom:
Iindidi ezahlukeneyo zoyilo lweefom zifuna utshintsho oluthile kuphawulo, kodwa ulawulo ngokwalo luhlala kwaye luziphatha ngendlela efanayo.
Iifom ze-Bootstrap ziquka izitayile zazo zonke iifom zolawulo ezisisiseko njengegalelo, i-textarea, kunye nokukhetha onokuyilindela. Kodwa ikwaza nenani lamalungu esiko afana namagalelo ahlonyelweyo kunye nangaphambili kunye nenkxaso yoluhlu lweebhokisi zokukhangela.
Amazwe afana nempazamo, isilumkiso, kunye nempumelelo zibandakanyiwe kuhlobo ngalunye lolawulo lwefomu. Kukwaqukwe izimbo zolawulo olukhubazekileyo.
I-Bootstrap inikeza uphawu olulula kunye nezitayile zeendlela ezine zeefom zewebhu eziqhelekileyo.
Igama | Iklasi | Inkcazo |
---|---|---|
Ngokuthe nkqo (okuhlala kukho) | .form-vertical (ayifuneki) |
Iileyibhile ezipakishwe, ezilungelelaniswe ekhohlo phezu kolawulo |
Nomgca | .form-inline |
Ileyibhile elungelelaniswe ekhohlo kunye nolawulo lwebhloko engaphakathi kwisitayela esihlangeneyo |
Khangela | .form-search |
Ukufakwa kombhalo ojikelezileyo owongezelelweyo kubuhle bokukhangela obuqhelekileyo |
Ukuthe tye | .form-horizontal |
Ileyibhile zilungelelaniswe ngasekhohlo, zilungelelaniswe ekunene kumgca ofanayo nolawulo |
I-Smart kunye ne-lightweight defaults ngaphandle kophawu olongezelelweyo.
- < iklasi yefom = "kakuhle" >
- <ileyibhile> Igama leleyibhile </ ileyibheli>
- <input type = "text" class = "span3" placeholder = " Chwetheza into..." >
- <span class = "help-block" > Umzekelo wokubhaliweyo koncedo lwebhloko apha. </ span>
- < iklasi yeleyibhile = "ibhokisi yokukhangela" >
- <input type = "checkbox" > Ndijonge
- </ ileyibheli>
- < uhlobo lweqhosha = "submit " class = "btn" > Ngenisa </ iqhosha>
- </ ifom>
Yongeza .form-search
kwifom .search-query
nakwi- input
.
- < iklasi yefom = "ukukhangela kakuhle ifom" >
- <input type = "text" class = "input-medium search-query" >
- < uhlobo lweqhosha = "submit " class = "btn" > Khangela </ iqhosha>
- </ ifom>
Yongeza .form-inline
ukulungelelanisa ulungelelwaniso oluthe nkqo kunye nezithuba zolawulo lwefom.
- < iklasi yefom = "ifom-inline kakuhle" >
- <input type = "text" class = "input-small" placeholder = "I-imeyile" >
- <input type = "password" class = "input-small" placeholder = "Password" >
- < iklasi yeleyibhile = "ibhokisi yokukhangela" >
- <input type = "checkbox" > Ndikhumbule
- </ ileyibheli>
- < uhlobo lweqhosha = "submit " class = "btn" > Sayina </ iqhosha>
- </ ifom>
Kuboniswe ngasekunene zonke iindlela zolawulo lwefomu esiluxhasayo. Nalu uluhlu oluneebhulethi:
Kunikwe lo mzekelo ungasentla uyilo lwefom, nalu uphawu olunxulunyaniswa negalelo lokuqala kunye neqela lolawulo. I- .control-group
,, .control-label
kunye .controls
neeklasi zonke ziyafuneka kwisitayile.
- < iklasi yefom = "ifom-horizontal" >
- <iseti yendawo>
- <legend> Isicatshulwa sentsomi </legend>
- <div class = "control-group" >
- < iklasi yeleyibhile = "control-label" for = "input01" > Igalelo lombhalo </label>
- <div class = "controls" >
- <input type = "text" class = "input-xlarge" id = "input01" >
- <p class = "help-block" > Isicatshulwa soncedo esixhasayo </p>
- </ div>
- </ div>
- </ iseti yendawo>
- </ ifom>
I-Bootstrap inezimbo zezitayile ze-browser exhaswayo ekugxilwe kuyo kunye disabled
nemimandla. Sisusa iWebkit engagqibekanga outline
kwaye sisebenzise indawo box-shadow
yayo :focus
.
Ikwabandakanya izimbo zokuqinisekisa iimpazamo, izilumkiso, kunye nempumelelo. Ukusebenzisa, yongeza iklasi yempazamo kwindawo engqongileyo .control-group
.
- <iseti yendawo
- class = "control-group error" >
- …
- </ iseti yendawo>
Amaqela ongeniso-nombhalo ohlonyelweyo okanye osele ubekiwe-abonelela ngendlela elula yokunika umxholo ongakumbi wamagalelo akho. Imizekelo emikhulu ibandakanya i-@ sign yee-username ze-Twitter okanye i-$ yezemali.
Ukuya kuthi ga kwi-v1.4, iBootstrap ifuna uphawu olongezelelweyo malunga neebhokisi zokukhangela kunye nonomathotholo ukuzipakisha. Ngoku, ngumcimbi olula wokuphinda <label class="checkbox">
esonga ifayile ye <input type="checkbox">
.
Iibhokisi zokukhangela ezingaphakathi kunye nonomathotholo nazo ziyaxhaswa. Yongeza nje .inline
kuyo nayiphi na .checkbox
okanye .radio
kwaye ugqibile.
Ukusebenzisa i-prepend okanye ukudibanisa amagalelo kwifom engaphakathi, qiniseka ukubeka .add-on
kunye input
nomgca omnye, ngaphandle kwezithuba.
Ukongeza isicatshulwa soncedo kwigalelo lakho lefom, bandakanya isicatshulwa soncedo esingaphakathi okanye ibhlokhi yombhalo <span class="help-inline">
woncedo <p class="help-block">
emva kwento yokufaka.
Endaweni yokwenza yonke i-icon ibe sisicelo esongezelelweyo, siyihlanganisele kwi-sprite-inqwaba yemifanekiso kwifayile enye esebenzisa i-CSS ukubeka imifanekiso nge background-position
. Le yindlela efanayo esiyisebenzisayo kwi-Twitter.com kwaye isisebenzele kakuhle.
Zonke iiklasi ze-icon zifakwe .icon-
kwi-prefix yeendawo ezifanelekileyo zamagama kunye ne-scoping, njengamanye amacandelo ethu. Oku kuya kunceda ukuphepha iingxabano kunye nezinye izixhobo.
I-Glyphicons isinike ukusetyenziswa kweeHalflings ezibekwe kwi-toolkit yethu evulekileyo yomthombo ukuba nje sibonelela ngekhonkco kunye nekhredithi apha kumaxwebhu. Nceda ucinge ngokwenza okufanayo kwiiprojekthi zakho.
I-Bootstrap isebenzisa <i>
ithegi yazo zonke ii-icon, kodwa ayinayo iklasi yecala-kuphela isimaphambili ekwabelwana ngaso. Ukusebenzisa, beka le khowudi ilandelayo naphi na:
- <i class = "icon-search" > </i>
Kukwakho nezitayile ezikhoyo kwii-icon eziguqulweyo (ezimhlophe), ezenziwe zalungiswa ngeklasi enye eyongezelelweyo:
- <i class = "icon-search icon-white" > </i>
Kukho iiklasi ezili-140 ongakhetha kuzo kwii-icon zakho. Yongeza nje <i>
ithegi kunye neeklasi ezifanelekileyo kwaye usetwe. Ungalufumana uluhlu olupheleleyo kwi sprites.less okanye apha kolu xwebhu.
Iintloko phezulu! Xa usebenzisa ecaleni kwemitya yokubhaliweyo, njengakumaqhosha okanye amakhonkco e-nav, qiniseka ukuba ushiya isithuba emva <i>
kwethegi yesithuba esifanelekileyo.
Iimpawu zilungile, kodwa umntu unokuzisebenzisa phi? Nazi iimbono ezimbalwa:
Ngokusisiseko, naphi na apho ungabeka khona <i>
ithegi, ungabeka i icon.
Zisebenzise kumaqhosha, amaqela amaqhosha ebar yesixhobo, ukukhangela, okanye amagalelo efomu esele ibekiwe.