Pamusoro pechikafu, zvinhu zveHTML zvekutanga zvakashongedzwa uye zvinokwidziridzwa nemakirasi akawedzera kupa kutsva, kuenderana kutaridzika uye kunzwa.
Iyo yese typographic grid yakavakirwa pane maviri Madiki akasiyana mune yedu variables.less faira: @baseFontSize
uye @baseLineHeight
. Yekutanga ndiyo base font-saizi inoshandiswa mukati mese uye yechipiri ndiyo base mutsetse-urefu.
Isu tinoshandisa izvo zvinosiyanisa, uye mamwe masvomhu, kugadzira miganho, padding, uye mutsara-urefu hwemhando yedu yese nezvimwe.
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.
Ita kuti ndima ibude pachena nekuwedzera .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
Element | Usage | Optional |
---|---|---|
<strong> |
Zvekusimbisa chidimbu chezvinyorwa zvine zvakakosha | Hapana |
<em> |
Zvekusimbisa chidimbu chemavara nekunetsekana | Hapana |
<abbr> |
Inopeta zvipfupiso uye acronyms kuratidza shanduro yakawedzerwa pane hover | Sanganisira .initialism kirasi kune zvipfupiso zvemavara makuru. |
<address> |
Kuti uwane ruzivo rwekufonera tateguru wayo ari pedyo kana boka rose rebasa | Chengetedza fomati nekugumisa mitsetse yese ne<br> |
Fusce dapibus , tellus ac cursus commodo , tortor mauris condimentum nibh , ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, pharetra augue.
Cherechedza: Inzwa wakasununguka kushandisa <b>
uye <i>
muHTML5, asi kushandiswa kwavo kwachinja zvishoma. <b>
inoitirwa kuratidza mazwi kana mitsara pasina kuendesa kukosha kwekuwedzera asi <i>
kazhinji iri yezwi, tekinoroji mazwi, nezvimwe.
Heino mienzaniso miviri yekuti <address>
tag ingashandiswa sei:
Zvidimburiso zvine title
hunhu zvine mwenje wepasi pebhodha uye chekubatsira pane hover. Izvi zvinopa vashandisi chiratidzo chekuwedzera chimwe chinhu chicharatidzwa pane hover.
Wedzera initialism
kirasi kuchidimbu kuti uwedzere typographic kuwirirana nekupa iyo diki diki saizi yemavara.
HTML ndicho chinhu chakanakisa kubva pachingwa chakachekwa.
Muchidimbu chezwi rokuti attr .
Element | Usage | Optional |
---|---|---|
<blockquote> |
Block-level element yekutora zvemukati kubva kune imwe sosi | Wedzera .pull-left uye .pull-right makirasi ezvisarudzo zvakayangarara |
<small> |
Optional element yekuwedzera inotarisana nemushandisi, kazhinji munyori ane zita rebasa | Isa iyo <cite> yakatenderedza zita kana zita rekwakabva |
Kusanganisira blockquote, peta <blockquote>
chero HTML se quote. Kuti uwane mazwi akatwasuka tinokurudzira a <p>
.
Sanganisira chinhu chinosarudzika <small>
kuti utaure kwaunobva uye iwe uchawana em dash —
pamberi payo nekuda kwemaitiro.
- <blockquote>
- <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante venenatis. </ p>
- <mudiki> Mumwe munhu ane mukurumbira </ mudiki>
- </blockquote>
Default blockquotes akanyorwa seizvi:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante venenatis.
Mumwe ane mukurumbira muBody yebasa
Kuyangarara yako blockquote kurudyi, wedzera class="pull-right"
:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante venenatis.
Mumwe ane mukurumbira muBody yebasa
<ul>
<ul class="unstyled">
<ol>
<dl>
<dl class="dl-horizontal">
Musoro! Tsanangudzo dzakachinjika dzinozodimburira mazwi akareba zvekusakwana muchikamu chekuruboshwe gadzirisa text-overflow
. Munzvimbo dzakatetepa dzekutarisa, ivo vanozochinja kune default stacked marongero.
Putira zvidimbu zvemukati zvekodhi ne <code>
.
- Semuyenzaniso , < code> chikamu </ code > inofanira kuputirwa se inline .
Shandisa<pre>
kune akawanda mitsara yekodhi. Ita shuwa kutiza mabhuraketi chero emakona ari mukodhi kuti ukwanise kuburitsa.
<p>Eyemuenzaniso mavara pano...</p>
- <pre>
- <p>Eyemuenzaniso mavara pano...</p>
- </pre>
Cherechedza: Iva nechokwadi chekuchengeta kodhi mukati<pre>
memategi pedyo nekuruboshwe sezvinobvira; ichapa ma tabo ese.
Iwe unogona kusarudza kuwedzera .pre-scrollable
kirasi iyo inoisa max-urefu hwe350px uye inopa y-axis scrollbar.
Tora <pre>
chinhu chimwe uye wedzera makirasi maviri esarudzo ekuwedzera shanduro.
- <p> Muenzaniso mavara pano... </p>
- <pre class = "prettyprint
- linenum" >
- <p>Eyemuenzaniso mavara pano...</p>
- </pre>
Dhawunirodha google-code-prettify uye woona iyo readme yekushandisa sei.
Tag | Tsanangudzo |
---|---|
<table> |
Kupeta chinhu chekuratidza data mune tabular fomati |
<thead> |
Chinhu chemudziyo wemitsara yemusoro wetafura ( <tr> ) kuisa mitsara yetafura |
<tbody> |
Container element yetafura mitsetse ( <tr> ) mumutumbi wetafura |
<tr> |
Container element yeseti yematafura maseru ( <td> kana <th> ) anooneka pamutsara mumwe |
<td> |
Default table cell |
<th> |
Yakakosha tafura sero yekoramu (kana mutsara, zvichienderana nehukuru uye kuiswa) mavara Anofanirwa kushandiswa mukati me <thead> |
<caption> |
Tsananguro kana pfupiso yezvakabatwa netafura, kunyanya inobatsira kuvaverengi vescreen |
- <tafura>
- <musoro>
- <tr>
- <th> … </th>
- <th> … </th>
- </ tr>
- </ musoro>
- <tbody>
- <tr>
- <td> … </td>
- <td> … </td>
- </ tr>
- </ tbody>
- </ table>
Zita | Kirasi | Tsanangudzo |
---|---|---|
Default | Hapana | Hapana masitaera, angori makoramu nemitsara |
Basic | .table |
Mitsetse yakachinjika chete pakati pemitsara |
Bordered | .table-bordered |
Inotenderera makona uye inowedzera muganhu wekunze |
Zebra-stripe | .table-striped |
Inowedzera grey kumashure kwemavara kune zvisingaite (1, 3, 5, nezvimwewo) |
Condensed | .table-condensed |
Inocheka yakatwasuka padding nepakati, kubva pa8px kusvika 4px, mukati mezvese td uye th zvinhu |
Matafura anongogadzirwa otomatiki aine mabhodha mashoma kuti ave nechokwadi chekuverengeka uye kuchengetedza chimiro. Ne 2.0, .table
kirasi inodiwa.
- <tafura yekirasi = "tafura" >
- …
- </ table>
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry | Shiri |
Wana shoo shoma nematafura ako nekuwedzera mbizi-striping-ingowedzera .table-striped
kirasi.
Cherechedza: Matafura ane mitsetse anoshandisa :nth-child
CSS selector uye haisi kuwanikwa muIE7-IE8.
- <tafura yekirasi = "tafura tafura-mitsetse" >
- …
- </ table>
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry | Shiri |
Wedzera miganho yakatenderedza tafura yese uye makona akatenderedzwa nekuda kwekunakisa.
- <tafura yekirasi = "tafura tafura-yakaganhurwa" >
- …
- </ table>
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
Mark | Otto | @getbootstrap | |
2 | Jacob | Thornton | @mafuta |
3 | Larry the Shiri |
Ita kuti matafura ako awedzere compact nekuwedzera .table-condensed
kirasi kutema tafura cell padding nehafu (kubva pa8px kusvika 4px).
- <tafura yekirasi = "tafura yetafura-yakaderedzwa" >
- …
- </ table>
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry the Shiri |
Inzwa wakasununguka kusanganisa chero emakirasi etafura kuti uwane kutaridzika kwakasiyana nekushandisa chero anowanikwa makirasi.
- <tafura kirasi = "tafura tafura-mitsetse tafura-yakaganhurwa tafura-yakapfupikiswa" >
- ...
- </ table>
Zita rizere | |||
---|---|---|---|
# | Zita rokutanga | Zita rokupedzisa | Username |
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry the Shiri |
Chikamu chakanakisa nezvemafomu muBootstrap ndechekuti zvese zvaunopinza uye zvinodzora zvinotaridzika zvakanaka zvisinei kuti unozvivaka sei mumarkup yako. Hapana yakanyanyisa HTML inodiwa, asi isu tinopa mapatani kune avo vanoida.
Mamwe magadzirirwo akaomesesa anouya nemakirasi akapfupika uye anogona scalable e nyore kutaera uye kusungirirwa kwechiitiko, saka unofukidzwa padanho rega rega.
Bootstrap inouya nerutsigiro rwemhando ina dzemafomu marongerwo:
Mhando dzakasiyana dzemagadzirirwo emafomu dzinoda shanduko kune markup, asi zvinodzora pachazvo zvinoramba uye zviite zvakafanana.
Mafomu eBootstrap anosanganisira masitayipi eese mabhesi fomu ekudzora senge kupinza, textarea, uye sarudza iwe yaungatarisira. Asi zvakare inouya nenhamba yezvimiro zvetsika senge zvakaiswa uye zvakafanorongedzerwa mapindiro uye tsigiro yemazita emabhokisi ekutarisa.
Nyika dzakaita senge kukanganisa, yambiro, uye kubudirira zvinosanganisirwa kune yega yega yemhando yekudzora fomu. Zvinosanganisirwawo masitayera ezvidzori zvakaremara.
Bootstrap inopa yakapusa markup uye masitaera mana masitaera eakajairwa mafomu ewebhu.
Zita | Kirasi | Tsanangudzo |
---|---|---|
Yakamira (default) | .form-vertical (hazvidiwi) |
Mapepa akaturikidzana, akaiswa kuruboshwe pamusoro pezvinodzora |
Inline | .form-inline |
Label yakatarisana nekuruboshwe uye inline-block zvidhiraivho zve compact style |
Search | .form-search |
Yakawedzerwa-yakatenderedzwa mavara ekuisa kune yakajairika kutsvaga aesthetic |
Horizontal | .form-horizontal |
Yangarara kuruboshwe, kurudyi-kurudyi mavara pamutsetse wakafanana sezvidzori |
Smart uye lightweight defaults pasina imwe markup.
- <form kirasi = "zvakanaka" >
- <label> Zita rezita </ label>
- <input type = "text" class = "span3" placeholder = " Taipa chimwe chinhu..." >
- <span class = "help-block" > Muenzaniso block-level rubatsiro runyorwa pano. </ span>
- <label class = "checkbox" >
- <input type = "checkbox" > Nditarise
- </ label>
- <button type = "submit" class = "btn" > Tumira </button>
- </ fomu>
Wedzera .form-search
kune fomu uye .search-query
kune input
.
- <form kirasi = "zvakanaka fomu-kutsvaga" >
- <input type = "text" class = "input-medium search-query" >
- <button type = "submit" class = "btn" > Tsvaga </button>
- </ fomu>
Wedzera .form-inline
ku faini kurongeka kwakatwasuka uye nzvimbo yezvidzoro zvefomu.
- <form kirasi = "zvakanaka fomu-inline" >
- <input type = "text" class = "input-small" placeholder = "Email" >
- <input type = "password" class = "input-small" placeholder = "Password" >
- <label class = "checkbox" >
- <input type = "checkbox" > Ndirangarirewo
- </ label>
- <button type = "submit" class = "btn" > Pinda </button>
- </ fomu>
Kunoratidzwa kurudyi ndiwo ese akajairika fomu anodzora atinotsigira. Heino rondedzero ine mabulleted:
Tichifunga nezvemuenzaniso wepamusoro dhizaini yefomu, heino markup yakabatana neyekutanga yekupinza uye kutonga boka. Iyo .control-group
,, .control-label
uye .controls
makirasi ese anodiwa pakuita styling.
- <form class = "form-horizontal" >
- <fieldset>
- <legend> Chinyorwa chengano </legend>
- <div class = "control-group" >
- <label class = "control-label" ye = "input01" > Kuisa mavara </label>
- <div class = "controls" >
- <input type = "text" class = "input-xlarge" id = "input01" >
- <p class = "help-block" > Mameseji erubatsiro anotsigira </p>
- </ div>
- </ div>
- </fieldset>
- </ fomu>
Bootstrap inoratidzira masitaera ebrowser-inotsigirwa yakatarisana uye disabled
nyika. Isu tinobvisa iyo default Webkit outline
uye toisa a box-shadow
panzvimbo yayo ye :focus
.
Inosanganisirawo zvitaera zvekusimbisa zvekukanganisa, yambiro, uye kubudirira. Kuti ushandise, wedzera kirasi yekukanganisa kune yakatenderedza .control-group
.
- <fieldset
- class = "control-group error" >
- …
- </fieldset>
Mapoka ekuisa — ane mavara akaiswa kana akafanorongwa — anopa nzira iri nyore yekupa mamwe mamiriro ezvaunoisa. Mienzaniso mikuru inosanganisira iyo @ sign ye Twitter usernames kana $ yemari.
Kusvika kuv1.4, Bootstrap yaida yakawedzera markup yakatenderedza mabhokisi ekutarisa nemaredhiyo kuti azviise. Zvino, inyaya yakapusa yekudzokorora <label class="checkbox">
iyo inoputira iyo <input type="checkbox">
.
Inline cheki mabhokisi uye redhiyo zvinotsigirwa zvakare. Ingo wedzera .inline
kune chero .checkbox
kana .radio
uye wapedza.
Kuti ushandise prepend kana kuwedzera mapimendi mune inline fomu, iva nechokwadi chekuisa .add-on
uye input
pamutsetse mumwechete, pasina nzvimbo.
Kuti uwedzere mameseji erubatsiro ezvaunopinda mufomu, sanganisira mavara erubatsiro emukati ane <span class="help-inline">
kana mameseji erubatsiro ane <p class="help-block">
mushure mechinhu chekuisa.
Panzvimbo pekuita kuti chiratidzo chega chega chive chikumbiro chekuwedzera, takazvibatanidza kuita sprite - boka remifananidzo mufaira rimwe rinoshandisa CSS kuisa mifananidzo ne background-position
. Iyi ndiyo nzira imwe chete yatinoshandisa pa Twitter.com uye yatiitira zvakanaka.
Ese makirasi ezvidhori .icon-
anotangwa neakakodzera mazita enzvimbo uye scoping, senge zvimwe zvinhu zvedu. Izvi zvichabatsira kudzivirira kusawirirana nemamwe maturusi.
Glyphicons yakatipa kushandisa maHalflings akaiswa mune yedu yakavhurika-sosi toolkit chero isu tichipa chinongedzo uye kiredhiti pano mune zvinyorwa. Ndapota funga kuita zvakafanana mumapurojekiti ako.
Bootstrap inoshandisa <i>
tag yezvidhori zvese, asi ivo havana kesi kirasi-chete yakagovaniswa prefix. Kuti ushandise, isa kodhi inotevera chero kupi zvako:
- <i class = "icon-search" > </i>
Kune zvakare masitaera anowanikwa kune inverted (chena) icons, akagadzirirwa nekirasi imwe yekuwedzera:
- <i class = "icon-search icon-white" > </i>
Kune 140 makirasi ekusarudza kubva kune ako icons. Ingo wedzera <i>
tag ine makirasi akakodzera uye wagadzirira. Unogona kuwana runyoro rwakazara mu sprites.less kana ipo pano mugwaro rino.
Musoro! Paunenge uchishandisa parutivi tambo dzemavara, semabhatani kana nav zvinongedzo, ita shuwa yekusiya nzvimbo mushure me <i>
tag yepakati yakakodzera.
Icons yakanaka, asi munhu angaishandisa kupi? Heano mamwe mazano:
Chaizvoizvo, chero kwaunogona kuisa <i>
tag, unogona kuisa icon.
Ashandise mumabhatani, mapoka emabhatani eturubhu, kufamba, kana mamepu akafanorongwa.