Pan tap di skɔf, dɛn stayl ɛn ɛnjɔy di bɛsis HTML ɛlimɛnt dɛn wit ɛkstensible klas dɛn fɔ gi wan fresh, kɔnsistɛns luk ɛn fil.
Di ɔl taypografik grid de bays pan tu Less vɛriɔbul dɛn na wi vayriɔbul dɛn.less fayl: @baseFontSize
ɛn @baseLineHeight
. Di fɔs wan na di bays font-sayz we dɛn yuz ɔlsay ɛn di sɛkɔn wan na di bays layn-ayt.
Wi de yuz dɛn vɛriɔbul dɛn de, ɛn sɔm mats, fɔ mek di margin, padding, ɛn layn-ayt dɛn fɔ ɔl wi tayp ɛn mɔ.
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus ɛn magnis dis we de bɔn pikin, nascetur ridiculus mus. Nullam id dolor id nibh ultrisis vehikula.
Mek wan paregraf difrɛn bay we yu ad .lead
.
Vivamus sagittis lakus vel augu laoreet rutrum faucibus dolor ɔkta. Duis mollis, est we nɔto kɔmɔdo luktɔs.
Tin | Aw fɔ yuz am | Pɔsibul |
---|---|---|
<strong> |
Fɔ ɛksplen wan smɔl tɛks wit impɔtant | Nɔn |
<em> |
Fɔ ɛksplen wan smɔl tɛks wit strɛs | Nɔn |
<abbr> |
Rap abrevieshɔn ɛn akɔdin fɔ sho di ɛkspanda vɛshɔn we de na hova | Inklud opshɔnal .initialism klas fɔ big big abrɛvieshɔn dɛn. |
<address> |
Fɔ kɔntakt infɔmeshɔn fɔ in gret gret granpa we de nia am ɔ di wan ol bɔdi fɔ wok | Priziv fɔmat bay we yu dɔn ɔl di layn dɛn wit<br> |
Fusce dapibus , tellus ac cursus commodo , tortor mauris kondimentum nibh , ut fεmεnt massa jכst sit amet risus. Maecenas faucibus mollis we de na di wɔl. Nulla vitae elit libero, we na wan pharetra augu.
Notis: Fil fri fɔ yuz <b>
ɛn <i>
insay HTML5, bɔt aw dɛn de yuz dɛn dɔn chenj smɔl. <b>
na fɔ aylayt wɔd ɔ frɛz dɛn we nɔ de gi ɔda impɔtants we <i>
na fɔ vɔys, tɛknikal wɔd dɛn, ɛn ɔda tin dɛn.
Na tu ɛgzampul dɛn ya bɔt aw dɛn <address>
kin yuz di tag:
Abbrevieshɔn dɛn wit title
atribyut gɛt layt dɔt bɔt bɔda ɛn ɛp kɔsa we de hova. Dis de gi yuzman dɛn ɛkstra indikashɔn fɔ sɔntin we dɛn go sho pan hova.
Ad di initialism
klas to wan abrevieshɔn fɔ mek di taypografik harmoni mɔ bay we yu gi am wan tɛks saiz we smɔl smɔl.
HTML na di bes tin sins slais bred.
Wan shɔt we fɔ di wɔd atribyut na attr .
Tin | Aw fɔ yuz am | Pɔsibul |
---|---|---|
<blockquote> |
Blɔk-lɛvel ɛlimɛnt fɔ kot kɔntinyu frɔm ɔda sɔs | Ad .pull-left ɛn .pull-right klas fɔ flot opshɔn dɛn |
<small> |
Opshɔnal ɛlimɛnt fɔ ad wan yuz-fes saytayshɔn, tipikli wan ɔda pɔsin we gɛt taytul fɔ wok | Put di <cite> rawnd di taytul ɔ di nem usay dɛn pul am |
Fɔ put blɔkkɔt, rap <blockquote>
rawnd ɛni HTML as di kot. Fɔ stret kot dɛn wi kin advays fɔ mek wan <p>
.
Inklud wan opshɔnal <small>
ɛlimɛnt fɔ sayt yu sɔs ɛn yu go gɛt wan em dash —
bifo am fɔ stayl pɔpɔshɔn dɛn.
- <blɔkkɔt>
- <p> Lorem ipsum dolor sidɔm amet, kɔnsɛktɛtur adipisin ɛlit. Intaj posuere erat wan ante venenatis. </p>we de sho aw fɔ du dat
- <small> Sɔmbɔdi we gɛt nem </small>
- </blɔkkɔt>
Difɔlt blɔkkɔt dɛn de stayl lɛk dis:
Lorem ipsum dolor sidon amet, konsektetur adipissing elit. Intaj posuere erat wan ante venenatis.
Sɔmbɔdi we gɛt nem na Bɔdi fɔ wok
Fɔ flot yu blɔkkɔt na di rayt say, ad class="pull-right"
:
Lorem ipsum dolor sidon amet, konsektetur adipissing elit. Intaj posuere erat wan ante venenatis.
Sɔmbɔdi we gɛt nem na Bɔdi fɔ wok
<ul>
<ul class="unstyled">
<ol>
<dl>
<dl class="dl-horizontal">
Hed dɛn de ɔp! Ɔrizɔntal diskripshɔn list dɛn go kɔt tɛm dɛn we tu lɔng fɔ fit insay di lɛft kɔlɔm fiks text-overflow
. Insay smɔl smɔl viupɔt dɛn, dɛn go chenj to di difɔlt layout we dɛn dɔn stak.
Rap inlayn snipet dɛn fɔ kɔd wit <code>
.
- Fɔ ɛgzampul , <kɔd> sɛkshɔn </ kɔd > fɔ rap lɛk inlayn .
Yuz <pre>
fɔ bɔku layn dɛn fɔ kɔd. Mek shɔ se yu rɔnawe pan ɛni angul brakɛt na di kɔd fɔ mek yu rɛnd fayn fayn wan.
<p>Sampul tɛks ya...</p>
- <prɛ>
- <p>Sampul tɛks ya...</p>
- </pre> fɔ di wan dɛn we de
Notis: Mek shɔ se yu kip kɔd insay <pre>
tag dɛn as klos to di lɛft as yu ebul; i go rɛnd ɔl di tab dɛn.
Yu kin opshɔnali ad di .pre-scrollable
klas we go sɛt maks-ayt fɔ 350px ɛn gi wan y-aks skrolba.
Tek di sem <pre>
ɛlimɛnt ɛn ad tu opshɔnal klas dɛn fɔ mek yu rɛnd fayn fayn wan.
- <p> Sampul tɛks ya... </p>
- <pre klas = "prɛti prɛnt ."
- linɔm dɛn" >
- <p>Sampul tɛks ya...</p>
- </pre> fɔ di wan dɛn we de
Daunlod google-code-prettify ɛn si di readme fɔ aw fɔ yuz am.
Pent | Tɔk bɔt |
---|---|
<table> |
Wrapping element fɔ sho data insay wan tebul fɔmat |
<thead> |
Kɔntinɛnt ɛlimɛnt fɔ tebul hεda rɔw dɛn ( <tr> ) fɔ lɛbul tebul kɔlɔm dɛn |
<tbody> |
Kɔntinɛnt ɛlimɛnt fɔ tebul rɔw dɛn ( <tr> ) na di bɔdi fɔ di tebul |
<tr> |
Kɔntinɛnt ɛlimɛnt fɔ wan sɛt fɔ tebul sɛl dɛn ( <td> ɔ <th> ) we de apia na wan rɔw |
<td> |
Difɔlt tebul sɛl |
<th> |
Speshal tebul sɛl fɔ kɔlɔm (ɔ row, dipen pan skɔp ɛn ples) lɛbl dɛn Yu fɔ yuz insay a <thead> |
<caption> |
Diskripshɔn ɔ sɔma fɔ wetin di tebul gɛt, mɔ fɔ di wan dɛn we de rid di skrin |
- <tebul>
- <di ed>
- <tr> fɔ di wan dɛn we de
- <th> ... </th> fɔ di wan dɛn we de
- <th> ... </th> fɔ di wan dɛn we de
- </tr>we de sho aw fɔ du dat
- </thead> fɔ di wan dɛn we de
- <tbɔdi>
- <tr> fɔ di wan dɛn we de
- <td> ... </td> fɔ di wan dɛn we de
- <td> ... </td> fɔ di wan dɛn we de
- </tr>we de sho aw fɔ du dat
- </tbɔdi>
- </tebul>
Nem | Klas | Tɔk bɔt |
---|---|---|
Balans | Nɔn | Nɔ stayl, na jɔs kɔlɔm ɛn row dɛn |
Men | .table |
Na ɔrizɔntal layn dɛn nɔmɔ de bitwin di row dɛn |
I gɛt bɔda | .table-bordered |
Raun kɔna ɛn ad ɔda bɔda |
Zɛbra-strip | .table-striped |
Ad layt grey bakgrɔn kɔlɔ to odd row dɛn (1, 3, 5, ɛn ɔda wan dɛn) |
Dɛn dɔn kɔndɛns am | .table-condensed |
Kɔt vertikal padding insay af, frɔm 8px to 4px, insay ɔl td ɛn th ɛlimɛnt dɛn |
Dɛn kin mek tebul dɛn ɔtomɛtik wan wit sɔm bɔda dɛn nɔmɔ fɔ mek shɔ se dɛn ebul fɔ rid dɛn ɛn fɔ mek dɛn kɔntinyu fɔ gɛt strɔkchɔ. Wit 2.0, di .table
klas nid fɔ de.
- <tebul klas = "tebul" >
- ...
- </tebul>
# Di wan dɛn we de | Fɔs nem | Las nem | Yuzɛn nem |
---|---|---|---|
1. Di wan dɛn we de | Mak | Ɔto bin de | @mdo na @mdo |
2. Di wan dɛn we de | Jekɔb | Tɔntɔn | @bɔmp |
3. Di wan dɛn we de | Lari bin de tɔk | di Bɔd | @twita na di twitter |
Gɛt smɔl fansi wit yu tebul dɛn bay we yu ad zibra-strip—jɔs ad di .table-striped
klas.
Notis: Striped tebul dɛn de yuz di :nth-child
CSS sɛlɛktɔ ɛn dɛn nɔ de na IE7-IE8.
- <tebul klas = "tebul tebul-strip" >
- ...
- </tebul>
# Di wan dɛn we de | Fɔs nem | Las nem | Yuzɛn nem |
---|---|---|---|
1. Di wan dɛn we de | Mak | Ɔto bin de | @mdo na @mdo |
2. Di wan dɛn we de | Jekɔb | Tɔntɔn | @bɔmp |
3. Di wan dɛn we de | Lari bin de tɔk | di Bɔd | @twita na di twitter |
Ad bɔda dɛn rawnd di wan ol tebul ɛn rawnd kɔna dɛn fɔ mek yu fayn.
- <tebul klas = "tebul-bɔda" >
- ...
- </tebul>
# Di wan dɛn we de | Fɔs nem | Las nem | Yuzɛn nem |
---|---|---|---|
1. Di wan dɛn we de | Mak | Ɔto bin de | @mdo na @mdo |
Mak | Ɔto bin de | @gɛtbɔtstrap | |
2. Di wan dɛn we de | Jekɔb | Tɔntɔn | @bɔmp |
3. Di wan dɛn we de | Larry di Bɔd | @twita na di twitter |
Mek yu tebul dɛn mɔ kɔmpakt bay we yu ad di .table-condensed
klas fɔ kɔt tebul sɛl pad insay af (frɔm 8px to 4px).
- <tebul klas = "tebul tebul-kɔndɛns" >
- ...
- </tebul>
# Di wan dɛn we de | Fɔs nem | Las nem | Yuzɛn nem |
---|---|---|---|
1. Di wan dɛn we de | Mak | Ɔto bin de | @mdo na @mdo |
2. Di wan dɛn we de | Jekɔb | Tɔntɔn | @bɔmp |
3. Di wan dɛn we de | Larry di Bɔd | @twita na di twitter |
Fil fri fɔ jɔyn ɛni wan pan di tebul klas dɛn fɔ ajɔst difrɛn luk dɛn bay we yu yuz ɛni wan pan di klas dɛn we de.
- <tebul klas = "tebul tebul-strip tebul-bɔda tebul-kɔndɛns" >
- ...
- </tebul>
Ful nem | |||
---|---|---|---|
# Di wan dɛn we de | Fɔs nem | Las nem | Yuzɛn nem |
1. Di wan dɛn we de | Mak | Ɔto bin de | @mdo na @mdo |
2. Di wan dɛn we de | Jekɔb | Tɔntɔn | @bɔmp |
3. Di wan dɛn we de | Larry di Bɔd | @twita na di twitter |
Di bɛst pat bɔt fɔm dɛn na Bootstrap na dat ɔl yu input ɛn kɔntrol dɛn luk fayn ilɛk aw yu bil dɛn na yu mak. No HTML we nɔ impɔtant nɔ nid, bɔt wi de gi di patɛns fɔ di wan dɛn we nid am.
Mɔ kɔmplikɛt layout dɛn kin kam wit sɔk ɛn skel klas dɛn fɔ izi stayl ɛn ivin binding, so yu de kɔba na ɛvri stɛp.
Bootstrap kam wit sɔpɔt fɔ 4 kayn fɔm layout dɛn:
Difrɛn kayn fɔm layout dɛn nid sɔm chenj dɛn fɔ mak, bɔt di kɔntrol dɛnsɛf de stil de ɛn dɛn de biev di sem.
Bootstrap in fɔm dɛn gɛt stayl dɛn fɔ ɔl di bays fɔm kɔntrol dɛn lɛk input, tɛksɛria, ɛn sɛlɛkshɔn we yu go ɛkspɛkt. Bɔt i kam bak wit bɔku kɔstɔm kɔmpɔnɛnt dɛn lɛk input dɛn we dɛn dɔn ad ɛn we dɛn dɔn pripen ɛn sɔpɔt fɔ list dɛn fɔ chɛkbɔks dɛn.
Stet dɛn lɛk mistek, wɔnin, ɛn sakrifays de insay fɔ ɛni kayn fɔm kɔntrol. Dɔn bak, dɛn put stayl dɛn fɔ kɔntrol dɛn we nɔ ebul fɔ waka.
Bootstrap de gi simpul mak ɛn stayl fɔ 4 stayl dɛn fɔ kɔmɔn wɛb fɔm dɛn.
Nem | Klas | Tɔk bɔt |
---|---|---|
Vɛtikal (difɔlt) . | .form-vertical (nɔ nid fɔ de) |
Stak, lɛft-alayn lɛbl dɛn oba kɔntrol dɛn |
Inlayn | .form-inline |
Left-alayned lebul ɛn inlayn-blɔk kɔntrol fɔ kɔmpakt stayl |
Luk fɔ | .form-search |
Ekstra-raun tɛks input fɔ wan tipik sɔch ɛstitik |
Bifo ɛn biɛn | .form-horizontal |
Flɔt lɛft, rayt-alayn lɛbl dɛn na di sem layn we di kɔntrol dɛn de |
Smat ɛn laytwɛt difɔlt dɛn we nɔ gɛt ɛkstra mak.
- <fɔm klas = "wɛl" >
- <lɛbul> Lebul nem </label>
- <input tayp = "tɛks" klas = "span3" pleshɔlda = "Tayp sɔntin..." >
- <span class = "help-block" > Ɛgzampul blɔk-lɛvel ɛp tɛks ya. </span> fɔ di wan dɛn we de
- <lɛbul klas = "chɛkbɔks" >
- <input type = "checkbox" > Chɛk mi aut
- </label> fɔ di wan dɛn we de
- <bɔtin tayp = "sɔbmit" klas = "btn" > Sɔbmit </bɔtin>
- </fɔm>
Ad .form-search
to di fɔm ɛn .search-query
to di input
.
- <fɔm klas = "wɛl fɔm-sɔch" >
- <input tayp = "tɛks" klas = "input-midiɔm sɔch-kwɛstyɔn" >
- <bɔtin tayp = "sɔbmit" klas = "btn" > Sɔch </bɔtin>
- </fɔm>
Ad .form-inline
fɔ fayn di vertikal alaynɛshɔn ɛn spɛshal fɔm kɔntrol dɛn.
- <fɔm klas = "wɛl fɔm-inlayn" >
- <input tayp = "tɛks" klas = "input-smɔl" pleshɔlda = "Imel" >
- <input tayp = "paswɔd" klas = "input-smɔl" pleshɔlda = "Paswɔd" >
- <lɛbul klas = "chɛkbɔks" >
- <input type = "checkbox" > Mɛmba mi
- </label> fɔ di wan dɛn we de
- <bɔtin tayp = "sɔbmit" klas = "btn" > Sayn insay </bɔtin>
- </fɔm>
Dɛn sho na di rayt say na ɔl di difɔlt fɔm kɔntrol dɛn we wi de sɔpɔt. Na di list we gɛt di bulɛt dɛn:
Gi di ɛgzampul fɔm layout we de ɔp, na di mak we gɛt fɔ du wit di fɔs input ɛn kɔntrol grup. Di .control-group
, .control-label
, ɛn .controls
klas dɛn ɔl nid fɔ stayl.
- <fɔm klas = "fɔm-ɔrizɔntal" >
- <fild sɛt>
- <lɛjɛnd> Lɛjɛnd tɛks </lɛjɛnd>
- <div klas = "kɔntrol-grup" >
- <lɛbul klas = "kɔntrol-lɛbul" fɔ = "input01" > Tɛks input </lɛbul>
- <div klas = "kɔntrol dɛn" >
- <input tayp = "tɛks" klas = "input-xlarge" id = "input01" >
- <p class = "help-block" > Sɔpɔt ɛp tɛks </p>
- </div> fɔ di wan dɛn we de
- </div> fɔ di wan dɛn we de
- </fild sɛt>
- </fɔm>
Bootstrap ficha stayl fɔ brawza-sɔpɔt fɔs ɛn disabled
stet. Wi de pul di difɔlt Wɛbkit outline
ɛn aplay wan box-shadow
insay in ples fɔ :focus
.
I gɛt bak validɛshɔn stayl dɛn fɔ mistek, wɔnin, ɛn sakrifays. Fɔ yuz, ad di mistek klas to di tin dɛn we de rawnd .control-group
.
- <fild sɛt
- klas = "kɔntrol-grup mistek" >
- ...
- </fild sɛt>
Input grup dɛn—wit tɛks we dɛn ad ɔ we dɛn dɔn ad bifo tɛm—de gi yu wan izi we fɔ gi mɔ kɔntɛks fɔ yu input dɛn. Gret ɛgzampul dɛn inklud di @ sayn fɔ Twitter yuzɛn nem ɔ $ fɔ faynans.
Te to v1.4, Bootstrap bin nid ɛkstra mak rawnd chɛkbɔks ɛn redio fɔ stak dɛn. Naw, na simpul tin fɔ ripit di <label class="checkbox">
we de rap di <input type="checkbox">
.
Inlayn chɛkbɔks ɛn redio dɛn de sɔpɔt bak. Jus ad .inline
to eni .checkbox
or .radio
en yu don don.
Fɔ yuz prɛpɛnd ɔ apɛnd input dɛn na inlayn fɔm, mek shɔ se yu put di .add-on
ɛn input
na di sem layn, we nɔ gɛt spɛs.
Fɔ ad ɛp tɛks fɔ yu fɔm input dɛn, put inlayn ɛp tɛks wit <span class="help-inline">
ɔ wan ɛp tɛks blɔk wit <p class="help-block">
afta di input ɛlimɛnt.
Bifo wi mek ɛvri aykɔn bi ɛkstra riŋwe, wi dɔn kɔmpilayt dɛn to wan sprite—wan bɔku pikchɔ dɛn na wan fayl we de yuz CSS fɔ put di pikchɔ dɛn wit background-position
. Dis na di sem we we wi de yuz fo Twitter.com and i don wok wel fo wi.
Ɔl di aykɔn klas dɛn gɛt prɛfiks wit .icon-
fɔ di rayt nemspɛs ɛn skɔp, jɔs lɛk wi ɔda kɔmpɔnɛnt dɛn. Dis go ɛp fɔ mek dɛn nɔ gɛt wanwɔd wit ɔda tul dɛn.
Glyphicons dɔn gi wi fɔ yuz di Halflings we dɛn dɔn sɛt na wi opin-sɔs tulkit sote wi de gi wan link ɛn kredit ya na di doks. Duya tink bɔt fɔ du di sem tin na yu prɔjek dɛn.
Bootstrap de yuz wan <i>
tag fɔ ɔl di aykɔn dɛn, bɔt dɛn nɔ gɛt kes klas—na wan prɛfiks nɔmɔ we dɛn sheb. Fɔ yuz am, put di kɔd we de dɔŋ ya jɔs lɛk ɛnisay:
- <i klas = "aykɔn-sɔch" </i>
Stayl dɛn de bak fɔ invayt (wayt) aykɔn dɛn, we dɛn mek rɛdi wit wan ɛkstra klas:
- <i klas = "aykɔn-sɔch aykɔn-wayt" ></i>
140 klas dɛn de fɔ pik frɔm fɔ yu aykɔn dɛn. Jɔs ad wan <i>
tag wit di rayt klas dɛn ɛn yu dɔn sɛt. Yu kin fɛn di ful list na sprites.less ɔ rayt ya na dis dɔkyumɛnt.
Hed dɛn de ɔp! We yu de yuz nia string dɛn we gɛt tɛks, lɛk bɔtin ɔ nav link dɛn, mek shɔ se yu lɛf ples afta di <i>
tɛg fɔ mek yu ebul fɔ spes fayn fayn wan.
Aykɔn dɛn fayn, bɔt usay pɔsin go yuz dɛn? Na sɔm aidia dɛn ya:
Essentially, eniwe yu fit put <i>
tag, yu fit put icon.
Yuz dɛn na bɔtin dɛn, bɔtin grup dɛn fɔ wan tulba, nevigishɔn, ɔ fɔm input dɛn we dɛn dɔn pripend.