CSS we dɛn kɔl CSS
Globɛl CSS sɛtin dɛn, fawndeshɔnal HTML ɛlimɛnt dɛn we dɛn stayl ɛn ɛnhans wit ɛkstensible klas dɛn, ɛn wan advans grid sistem.
Globɛl CSS sɛtin dɛn, fawndeshɔnal HTML ɛlimɛnt dɛn we dɛn stayl ɛn ɛnhans wit ɛkstensible klas dɛn, ɛn wan advans grid sistem.
Gɛt di lowdown pan di ki pies dɛm fɔ Bootstrap in infrastukchɔ, inklud wi we fɔ bɛtɛ, fasta, strɔng wɛb divɛlɔpmɛnt.
Bootstrap de mek yus to sɔm HTML ɛlimɛnt dɛn ɛn CSS prɔpati dɛn we nid fɔ yuz di HTML5 dɔktayp. Put am insay di biginin fɔ ɔl yu prɔjek dɛn.
Wit Bootstrap 2, wi ad opshɔnal mobayl frenli stayl fɔ ki aspek dɛn fɔ di fremwɔk. Wit Bootstrap 3, wi don rirayt di projek fo bi mobayl frenli from di stat. Insted of ad pan opshonal mobayl stail, dem de bek rait in di kor. Infakt, Bootstrap na mobayl fɔs . Yu kin fɛn mobayl fɔs stayl dɛn ɔlsay na di wan ol laybri instead fɔ de na difrɛn fayl dɛn.
Fɔ mek shɔ se yu rɛnd fayn ɛn tɔch di zum, ad di viewport mɛta tag to yu <head>
.
Yu kin disable di zooming kapabiliti dɛn na mobayl divays dɛn bay we yu ad user-scalable=no
to di viewport meta tag. Dis kin mek yu nɔ ebul fɔ zum, we min se di wan dɛn we de yuz am kin jɔs ebul fɔ skrol, ɛn i kin mek yu sayt fil smɔl lɛk nativ aplikeshɔn. Ɔl togɛda, wi nɔ de advays dis na ɔl di sayt dɛn, so tek tɛm!
Bootstrap de sɛt di bɛsis glob ɔl displei, taypografi, ɛn link stayl dɛn. Speshali, wi:
background-color: #fff;
pan dibody
@font-family-base
, @font-size-base
, ɛn @line-height-base
atribyut dɛn as wi taypografik bays@link-color
ɛn aplay link ɔndalayn dɛn nɔmɔ pan:hover
Yu kin fɛn dɛn stayl dɛn ya insay scaffolding.less
.
Fɔ mek yu ebul fɔ rɛnd di krɔs-brawza fayn fayn wan, wi de yuz Normalize.css , we na wan prɔjek we Nicolas Gallagher ɛn Jonathan Neal bin du .
Bootstrap nid wan containing element fɔ rap sayt kɔntinyu ɛn haus wi grid sistem. Yu kin pik wan pan tu kɔntena dɛn fɔ yuz fɔ du yu prɔjek dɛn. Notis se, bikɔs ɔf padding
ɛn mɔ, nɔto ɔl tu di kɔntena dɛn nɔ de nestable.
Yuz .container
fɔ wan kɔntena we gɛt fiks wit we de ansa.
Yuz .container-fluid
fɔ wan ful wit kɔntena, we de span di wan ol wit fɔ yu viupɔt.
Bootstrap inklud wan rispɔnsiv, mobayl fɔs fluid grid sistem we de skel fayn fayn wan te to 12 kɔlɔm dɛn as di divays ɔ viupɔt saiz de go ɔp. I inklud prɛdifayn klas dɛn fɔ izi layout opshɔn dɛn, ɛn bak pawaful miksin dɛn fɔ jenarayz mɔ sɛmantik layout dɛn .
Grid sistem dɛn de fɔ mek pej layout dɛn tru wan siriɔs row ɛn kɔlɔm dɛn we de kip yu kɔntinyu. Na so di Bootstrap grid sistem de wok:
.container
(fiks-wid) ɔ .container-fluid
(ful-wid) fɔ mek dɛn alaynɛd ɛn pad fayn fayn wan..row
ɛn .col-xs-4
de fɔ mek grid layout kwik kwik wan. Less mixins kin yuz bak fɔ mɔ sɛmantik layout dɛn.padding
. Dat padding de ofset in rows fɔ di fɔs ɛn las kɔlɔm via negatif margin pan .row
s..col-xs-4
..col-md-*
klas to wan ɛlimɛnt nɔ go jɔs afɛkt in stayl pan midul divays dɛn bɔt i go afɛkt big divays dɛn bak if wan .col-lg-*
klas nɔ de.Luk to di ɛgzampul dɛn fɔ yuz dɛn prinsipul ya fɔ yu kɔd.
Wi de yuz di midia kwɛstyɔn dɛn we de dɔŋ ya na wi Less fayl dɛn fɔ mek di ki brekpɔynt dɛn na wi grid sistɛm.
Wan wan tɛm wi kin ɛkspɛn pan dɛn midia kwɛstyɔn dɛn ya fɔ inklud wan max-width
fɔ stɔp CSS to wan smɔl sɛt fɔ divays dɛn.
Si aw aspek dɛn fɔ di Bootstrap grid sistem de wok akɔdin to bɔku divays dɛn wit wan tebul we izi fɔ yuz.
Ekstra smɔl divays dɛn Fɔn dɛn (<768px) | Smɔl divays dɛn Tablɛt dɛn (≥768px) | Midul divays dɛn Dɛsktɔp dɛn (≥992px) | Big big divays dɛn Dɛsktɔp dɛn (≥1200px) | |
---|---|---|---|---|
Grid bihayvya | Ɔrizɔntal ɔltɛm | Kollaps fɔ stat, ɔrizɔntal ɔp brekpɔynt dɛn | ||
Width fɔ di kɔntena | Nɔn nɔ de (ɔto) . | 750px na di pikchɔ | 970px na di pikchɔ | 1170px na di pikchɔ |
Klas prɛfiks | .col-xs- |
.col-sm- |
.col-md- |
.col-lg- |
# fɔ kɔlɔm dɛn | 12 we de tɔk bɔt | |||
Width fɔ di kɔlɔm | Ɔto | ~62px fɔ di wan dɛn we de | ~81px fɔ di wan dɛn we de | ~97px fɔ di wan dɛn we de |
Width fɔ di gɔta | 30px (15px na ɛni say na wan kɔlɔm) | |||
Nestable fɔ di wan dɛn we de | Yɛs | |||
Ɔfset dɛn | Yɛs | |||
Kɔlɔm fɔ ɔda | Yɛs |
Yuz wan sɛt fɔ .col-md-*
grid klas, yu kin mek wan besik grid sistem we de stat fɔ stak pan mobayl divays ɛn tablɛt divays dɛn (di ɛkstra smɔl to smɔl rɛnj) bifo i bi ɔrizɔntal pan dɛsktɔp (midul) divays dɛn. Put grid kɔlɔm dɛn na ɛni wan pan dɛn .row
.
Tɔn ɛni fiks-wid grid layout to ful-wid layout bay we yu chenj yu ɔda .container
wan to .container-fluid
.
Yu nɔ want yu kɔlɔm dɛn fɔ jɔs stak insay smɔl smɔl divays dɛn? Yuz di ekstra smɔl ɛn midul divays grid klas dɛn bay we yu ad .col-xs-*
.col-md-*
to yu kɔlɔm dɛn. Si di ɛgzampul we de dɔŋ fɔ no mɔ bɔt aw ɔltin de wok.
Bil pan di ɛgzampul we bin dɔn de bifo bay we yu mek ivin mɔ dinamik ɛn pawaful layout dɛn wit tablɛt .col-sm-*
klas dɛn.
If dɛn put pas 12 kɔlɔm dɛn insay wan row, ɛni grup we gɛt ɛkstra kɔlɔm dɛn go, as wan yunit, rap pan nyu layn.
Wit di fo taya grid dem we de yu go bound fo ron insaid ishu dem we, fo som brekpoint, yu kolm dem no klia kwik rait as wan de tol pas di oda wan. Fɔ fiks dat, yuz wan kɔmbaynshɔn fɔ a .clearfix
ɛn wi rispɔnsiv yutiliti klas dɛn .
Apat frɔm we yu de klia di kɔlɔm na di say dɛn we yu de brek we de ansa, yu kin nid fɔ riset ɔfset, push, ɔ pul . Si dis in akshɔn na di grid ɛgzampul .
Muv kɔlɔm dɛn to di rayt say yuz .col-md-offset-*
klas dɛn. Dɛn klas ya kin mek di lɛft say na wan kɔlɔm bɔku bay *
kɔlɔm dɛn. Fɔ ɛgzampul, .col-md-offset-4
i de muv .col-md-4
oba 4 kɔlɔm dɛn.
Yu kin ɔvalayz ɔfset dɛn bak frɔm lɔwa grid taya dɛn wit .col-*-offset-0
klas dɛn.
Fɔ nest yu kɔntinyu wit di difɔlt grid, ad nyu .row
ɛn sɛt fɔ .col-sm-*
kɔlɔm dɛn insay wan .col-sm-*
kɔlɔm we dɔn de. Di rɔw dɛn we dɛn dɔn nɛst fɔ gɛt wan sɛt fɔ kɔlɔm dɛn we ad to 12 ɔ smɔl pas dat (i nɔ nid fɔ mek yu yuz ɔl di 12 kɔlɔm dɛn we de).
I izi fɔ chenj di ɔda we fɔ wi bilt-in grid kɔlɔm dɛn wit .col-md-push-*
ɛn .col-md-pull-*
modifya klas dɛn.
Apat frɔm di grid klas dɛn we dɛn dɔn bil bifo tɛm fɔ fast layout, Bootstrap inklud Less variables ɛn mixins fɔ kwik kwik wan jenarayz yu yon simpul, sɛmantik layout dɛn.
Variables de ditarmin di nomba of kolm, di gutter width, en di midia kweshon point we yu go bigin flot kolm. Wi de yuz dɛn wan ya fɔ jenarayz di prɛdifayn grid klas dɛn we dɛn dɔn dɔkyumɛnt ɔp, ɛn bak fɔ di kɔstɔm miksin dɛn we de dɔŋ ya.
Mixins de yuz in kɔnjɔkt wit di grid vɛriɔbul dɛn fɔ jenarayz sɛmantik CSS fɔ wan wan grid kɔlɔm dɛn.
Yu kin chenj di vɛriɔbul dɛn to yu yon kɔstɔm valyu dɛn, ɔ jɔs yuz di miksin dɛn wit dɛn difɔlt valyu dɛn. Na dis na ɛgzampul fɔ yuz di difɔlt sɛtin dɛn fɔ mek tu-kɔlɔm layout wit gap bitwin.
Ɔl di HTML ɛd dɛn, <h1>
te to <h6>
, de. .h1
tru .h6
klas dɛn de bak, fɔ we yu want fɔ mach di font stayl fɔ wan ɛd bɔt stil want fɔ mek yu tɛks sho insay layn.
h1. Bootstrap we de na di ed |
Semibold na 36px |
h2. Bootstrap we de na di ed |
Semibold na 30px |
h3. Bootstrap we de na di ed |
Semibold na 24px |
h4. Bootstrap we de na di ed |
Semibold na 18px |
h5. Bootstrap we de na di ed |
Semibold na 14px |
h6. Bootstrap we de na di ed |
Semibold na 12px |
Krio layt, sɛkɔndari tɛks insay ɛni edlayn wit wan jenɛrik <small>
tag ɔ di .small
klas.
h1. Bootstrap heading Sɛkɔndari tɛks |
h2. Bootstrap heading Sɛkɔndari tɛks |
h3. Bootstrap heading Sɛkɔndari tɛks |
h4. Bootstrap heading Sɛkɔndari tɛks |
h5. Bootstrap heading Sɛkɔndari tɛks |
h6. Bootstrap heading Sɛkɔndari tɛks |
Bootstrap in glob ɔl difɔlt font-size
na 14px , wit wan line-height
we na 1.428 . Dɛn kin yuz dis fɔ di <body>
ɛn ɔl di paregraf dɛn. Apat frɔm dat, <p>
(paragraf dɛn) kin gɛt wan bɔt margin we na af pan dɛn kɔmpyutayt layn-ayt (10px bay difɔlt).
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.
Cum sociis natoque penatibus ɛn magnis dis we de bɔn pikin, nascetur ridiculus mus. Donec ullamcorper nulla non metus ɔktɔ fringila. Duis mollis, est non komodo luktus, nisi erat porttitor ligula, eget lasinia odio sem nec elit. Donec ullamcorper nulla non metus ɔktɔ fringila.
Maecenas sed diam eget risus varius blandit sidɔm amet nɔ magna. Donec id elit non mi porta gravida na eget metus. Duis mollis, est non komodo luktus, nisi erat porttitor ligula, eget lasinia odio sem nec elit.
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.
Di taypografik skel na bays pan tu Less vεriεbul dεm insay vεriεbul dεm.less : @font-size-base
εn @line-height-base
. 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 simpul mats fɔ mek di margin, padding, ɛn layn-ayt dɛn fɔ ɔl wi tayp ɛn mɔ. Kastamayz dɛn ɛn Bootstrap de adap.
Fɔ aylayt wan rɔn fɔ tɛks bikɔs i rili impɔtant na ɔda kɔntɛks, yuz di <mark>
tɛg.
Yu kin yuz di mak tag fɔshotɛks.
Fɔ sho blɔk dɛn fɔ tɛks we dɛn dɔn dilit yuz di <del>
tag.
Dis layn fɔ tɛks min fɔ trit am lɛk tɛks we dɛn dɔn dilit.
Fɔ sho blɔk dɛn fɔ tɛks we nɔ rili impɔtant igen yuz di <s>
tag.
Dɛn min fɔ trit dis layn na di tɛks as sɔntin we nɔ kɔrɛkt igen.
Fɔ sho wetin dɛn ad to di dɔkyumɛnt yuz di <ins>
tag.
Dis layn fɔ di tɛks min fɔ trit am as sɔntin we dɛn ad to di dɔkyumɛnt.
Fɔ ɔndalayn tɛks yuz di <u>
tag.
Dis layn fɔ di tɛks go rɛnd lɛk aw dɛn ɔndalayn am
Mek yus to HTML in difɔlt ɛmpɛshmɛnt tɛg dɛn wit laytwɛt stayl dɛn.
Fɔ de-ɛmpɛshi inlayn ɔ blɔk dɛn fɔ tɛks, yuz di <small>
tɛg fɔ sɛt tɛks na 85% di sayz fɔ di mama ɔ papa. Hɛdin ɛlimɛnt dɛn kin gɛt dɛn yon font-size
fɔ nɛst <small>
ɛlimɛnt dɛn.
Yu kin yuz wan inlayn ɛlimɛnt ɔda we wit .small
in ples fɔ ɛni <small>
.
Dis layn fɔ di tɛks dɛn min fɔ trit am lɛk fayn print.
Fɔ ɛksplen wan smɔl tɛks wit wan font-weit we ebi.
Di smɔl pat pan di tɛks we de dɔŋ ya de sho as bold tɛks .
Fɔ ɛksplen wan smɔl tɛks wit italiks.
Di smɔl pat pan di tɛks we de dɔŋ ya de sho lɛk tɛks we dɛn rayt italiks .
Fil fri fɔ yuz <b>
ɛn <i>
insay HTML5. <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.
I izi fɔ rialayn tɛks to kɔmpɔnɛnt dɛn wit tɛks alaynɛshɔn klas dɛn.
Tekst we de alaynɛd na di lɛft.
Di tɛks we dɛn alaynɛd na di sɛnta.
Tekst we dɛn alaynɛd rayt.
Tekst we gɛt rayt fɔ du dat.
Nɔ wrap tɛks.
Transfɔm tɛks insay kɔmpɔnɛnt dɛn wit tɛks kapitaylayz klas dɛn.
Tekst we gɛt smɔl smɔl lɛta dɛn.
Di tɛks we gɛt big big lɛta dɛn.
Tekst we dɛn rayt wit big big wan.
Stylized implimentishɔn fɔ HTML in <abbr>
ɛlimɛnt fɔ abrevieshɔn ɛn akɔdin fɔ sho di ɛkspanda vɛshɔn pan hova. Abbrevieshɔn dɛn wit title
atribyut gɛt layt dɔt bɔt bɔda ɛn ɛp kɔsa we yu de hova, we de gi ɔda kɔntɛks we yu de hova ɛn to di wan dɛn we de yuz ɛp tɛnkɔlɔji dɛn.
Wan shɔt we fɔ di wɔd atribyut na attr .
Ad .initialism
to wan abrevieshɔn fɔ wan smɔl font-sayz.
HTML na di bes tin sins slais bred.
Prɛzɛnt kɔntakt infɔmeshɔn fɔ di gret gret granpa we de nia yu ɔ di wan ol bɔdi fɔ wok. Priziv fɔmat bay we yu dɔn ɔl di layn dɛn wit <br>
.
Fɔ kot blɔk dɛn fɔ kɔntinyu frɔm ɔda sɔs insay yu dɔkyumɛnt.
Rap <blockquote>
rawnd ɛni HTML as di kot. Fɔ kot dɛn we rayt, wi kin advays yu fɔ yuz wan <p>
.
Lorem ipsum dolor sidon amet, konsektetur adipissing elit. Intaj posuere erat wan ante.
Stayl ɛn kɔntinyu chenj fɔ simpul chenj dɛn pan wan standad <blockquote>
.
Ad wan <footer>
fɔ no di say we dɛn pul am. Rap di nem fɔ di sɔs wok insay <cite>
.
Lorem ipsum dolor sidon amet, konsektetur adipissing elit. Intaj posuere erat wan ante.
Ad .blockquote-reverse
fɔ wan blɔkkɔt wit kɔntinyu we dɛn alaynɛd rayt.
Wan list fɔ di tin dɛn we di ɔda nɔ impɔtant klia wan.
Wan list fɔ di tin dɛn we di ɔda impɔtant klia wan.
Rimov di difɔlt list-style
ɛn lɛft margin na di list aytem dɛn (pikin dɛn nɔmɔ). Dis de onli aplay to immediate pikin list items , we min se yu go nid fɔ ad di klas fɔ ɛni nest list bak.
Put ɔl di list tin dɛn na wan layn wit display: inline-block;
ɛn sɔm layt pad.
Wan list fɔ di wɔd dɛn wit di diskripshɔn dɛn we gɛt fɔ du wit dɛn.
Mek tɛm ɛn diskripshɔn dɛn na <dl>
layn ɔp sayd-to-sayd. Start off stacked laik difolt <dl>
s, bot wen di navbar expand, so du dis.
Ɔrizɔntal diskripshɔn list dɛn go kɔt di wɔd dɛn we tu lɔng fɔ fit na di lɛft kɔlɔm wit 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>
.
<section>
dɛn fɔ rap am as inlayn.
Yuz di <kbd>
fɔ sho input we dɛn kin yuz kibɔd.
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>
Yu kin opshɔn fɔ ad di.pre-scrollable
klas, we go sɛt maks-ayt fɔ 350px ɛn gi yu y-aks skrolba.
Fɔ sho di vayriɔbul dɛn yuz di <var>
tag.
y = m x + b ɛn b
Fɔ sho blɔk dɛn sampul autput frɔm wan program yuz di <samp>
tag.
Dis tɛks min fɔ trit am lɛk ɛgzampul autput frɔm kɔmpyuta program.
Fɔ di bɛsis stayl—layt pad ɛn jɔs ɔrizɔntal divayda dɛn—ad di bays klas .table
to ɛni <table>
. I kin tan lɛk se i supa ridandant, bɔt bikɔs dɛn de yuz tebul dɛn bɔku bɔku wan fɔ ɔda plɔgin dɛn lɛk kalenda ɛn de pik dɛn, wi dɔn pik fɔ ayd wi kɔstɔm tebul stayl dɛn.
# 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 | @twitter na di twitter |
Yuz .table-striped
fɔ ad zibra-strip to ɛni tebul row insay di <tbody>
.
Dɛn kin mek di tebul dɛn we gɛt strɛp bay di :nth-child
CSS sɛlɛktɔ, we nɔ de na Intanɛt Ɛksplɔrɔ 8.
# 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 | @twitter na di twitter |
Ad .table-bordered
fɔ bɔda dɛn na ɔl di say dɛn na di tebul ɛn di sɛl dɛn.
# 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 | @twitter na di twitter |
Add .table-hover
fɔ ɛnabul wan hova stet pan tebul row dɛn insay wan <tbody>
.
# 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 | @twitter na di twitter |
Ad .table-condensed
fɔ mek tebul dɛn kɔmpakt mɔ bay we yu kɔt sɛl pad insay af.
# 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 | @twitter na di twitter |
Yuz kɔntɛkstual klas fɔ kala tebul rɔw ɔ wan wan sɛl dɛn.
Klas | Tɔk bɔt |
---|---|
.active |
Aplay di hova kala to wan patikyula row ɔ sɛl |
.success |
I de sho se pɔsin dɔn du sɔntin fayn ɔ i dɔn du gud tin |
.info |
I de sho se na nyutral infɔmeshɔnal chenj ɔ akshɔn |
.warning |
I de sho se dɛn gɛt wɔnin we go nid fɔ pe atɛnshɔn |
.danger |
I de sho se dɛn du sɔntin we denja ɔ we go mek dɛn du bad tin |
# Di wan dɛn we de | Di edlayn fɔ di kɔlɔm | Di edlayn fɔ di kɔlɔm | Di edlayn fɔ di kɔlɔm |
---|---|---|---|
1. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
2. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
3. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
4. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
5. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
6. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
7. 7. Di wan dɛn we de wok | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
8. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
9. Di wan dɛn we de | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm | Di tin dɛn we de insay di kɔlɔm |
Yuz kala fɔ ad minin to wan tebul row ɔ wan wan sɛl de jɔs gi wan vishɔnal indikashɔn, we dɛn nɔ go gi to di wan dɛn we de yuz ɛtɛknɔlɔji dɛn we de ɛp – lɛk skrin rida dɛn. Mek shɔ se di infɔmeshɔn we dɛn sho wit di kɔlɔ de sho klia wan frɔm di tin we de insay insɛf (di tɛks we yu de si na di tebul rɔw/sɛl we gɛt fɔ du wit am), ɔ dɛn put am insay ɔda we dɛn, lɛk ɔda tɛks we dɛn ayd wit di .sr-only
klas.
Krio tebul dɛn we de ansa bay we yu rap ɛni wan .table
pan dɛn .table-responsive
fɔ mek dɛn skrol ɔrizɔntal wan pan smɔl divays dɛn (ɔnda 768px). We yu de wach pan ɛnitin we big pas 768px waid, yu nɔ go si ɛni difrɛns na dɛn tebul dɛn ya.
Tebul dɛn we de ansa kin yuz overflow-y: hidden
, we kin klip ɛnitin we de insay di tebul we de dɔŋ ɔ ɔp. Na mɔtalman, dis kin klip ɔf drɔpdɔwn mɛnyu dɛn ɛn ɔda tɔd-pati widget dɛn.
Fayafaks gɛt sɔm awkward fil sɛt stayl we involv width
we de ambɔg di rispɔnsiv tebul. Dis nɔ go ebul fɔ ɔvalayz if yu nɔ gɛt Fayafaks-spɛsifi k hak we wi nɔ de gi na Bootstrap:
Fɔ no mɔ, rid dis Stak Ɔvaflɔ ansa .
# Di wan dɛn we de | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul |
---|---|---|---|---|---|---|
1. Di wan dɛn we de | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl |
2. Di wan dɛn we de | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl |
3. Di wan dɛn we de | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl |
# Di wan dɛn we de | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul | Di edlayn fɔ di tebul |
---|---|---|---|---|---|---|
1. Di wan dɛn we de | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl |
2. Di wan dɛn we de | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl |
3. Di wan dɛn we de | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl | Tebul sɛl |
Individyual fɔm kɔntrol dɛn kin gɛt sɔm glob ɔl stayl dɛn ɔtomɛtik wan. Ɔl di tɛkstual <input>
, <textarea>
, ɛn <select>
ɛlimɛnt dɛn wit .form-control
dɛn dɔn sɛt to width: 100%;
bay difɔlt. Rap lɛbl ɛn kɔntrol dɛn insay .form-group
fɔ mek yu gɛt di bɛst spɛshal say.
Nɔ miks fɔm grup dɛn dairekt wit input grup dɛn . Bifo dat, nest di input grup insay di fɔm grup.
Ad .form-inline
to yu fɔm (we nɔ nid fɔ bi <form>
) fɔ kɔntrol dɛn we de alaynɛd na di lɛft ɛn inlayn-blɔk. Dis kin jɔs apin to fɔm dɛn we de insay viupɔt dɛn we at le 768px waid.
Input ɛn sɛlɛkt dɛn dɔn width: 100%;
aplay bay difɔlt na Bootstrap. Insay inlayn fɔm dɛn, wi kin riset dat to width: auto;
so bɔku kɔntrol dɛn go ebul fɔ de na di sem layn. Dipen pan yu layout, dɛn kin nid fɔ mek ɔda kɔstɔm wit dɛn.
Di wan dɛn we de rid di skrin go gɛt prɔblɛm wit yu fɔm dɛn if yu nɔ put lɛbl fɔ ɛvri input. Fɔ dɛn inlayn fɔm dɛn ya, yu kin ayd di lɛbl dɛn we yu de yuz di .sr-only
klas. Ɔda we dɛn de fɔ gi lɛbl fɔ ɛp tɛknɔlɔji dɛn, lɛk di aria-label
, aria-labelledby
ɔ title
atribyut. If nɔ pan dɛn tin ya nɔ de, di wan dɛn we de rid di skrin kin yuz di placeholder
atribyut, if i de, bɔt notis se placeholder
dɛn nɔ advays fɔ yuz am as ples fɔ ɔda we dɛn fɔ lɛbul.
Yuz Bootstrap in prɛdifayn grid klas dɛn fɔ alaynɛd lɛbl ɛn grup dɛn fɔ fɔm kɔntrol dɛn na wan ɔrizɔntal layout bay we yu ad .form-horizontal
to di fɔm (we nɔ nid fɔ bi wan <form>
). We yu du dat, i de chenj .form-group
s fɔ biev lɛk grid rɔw, so nɔ nid fɔ .row
.
Ɛgzampul dɛn fɔ standad fɔm kɔntrol dɛn we dɛn sɔpɔt insay wan ɛgzampul fɔm layout.
Mɔs kɔmɔn fɔm kɔntrol, tɛks-bɛs input fil dɛn. Inklud sɔpɔt fɔ ɔl di kayn HTML5 dɛn: text
, password
, datetime
, datetime-local
, date
, month
, time
, week
, number
, email
, url
, search
, tel
, ɛn color
.
Input dɛn go jɔs ful-ɔp wit stayl if dɛn type
deklare dɛn fayn fayn wan.
Fɔ ad intagreted tɛks ɔ bɔtin dɛn bifo ɛn/ɔ afta ɛni tɛks-based <input>
, chɛk di input grup kɔmpɔnɛnt .
Fɔm kɔntrol we de sɔpɔt bɔku layn dɛn na tɛks. Chenj rows
atribyut as nid de.
Chɛkbɔks dɛn na fɔ pik wan ɔ sɔm tin dɛn we de na wan list, ɛn redio dɛn na fɔ pik wan tin dɛn frɔm bɔku pan dɛn.
Dɛn sɔpɔt chɛkbɔks ɛn redio dɛn we nɔ ebul fɔ wok, bɔt fɔ gi "nɔ alaw" kɔsa we yu de hov di mama ɔ papa <label>
, yu go nid fɔ ad di .disabled
klas to di mama ɔ papa .radio
, .radio-inline
, .checkbox
, ɔ .checkbox-inline
.
Yuz di .checkbox-inline
ɔ .radio-inline
klas dɛn na wan siriɔs chɛkbɔks ɔ redio fɔ kɔntrol dɛn we de apia na di sem layn.
If yu nɔ gɛt ɛni tɛks insay di <label>
, di input de pozishɔn lɛk aw yu go ɛkspɛkt. Naw, i de wok nɔmɔ pan chɛkbɔks ɛn redio dɛn we nɔ de insay di intanɛt. Mɛmba fɔ stil gi sɔm kayn lɛbl fɔ ɛp tɛknɔlɔji dɛn (fɔ ɛgzampul, yuz aria-label
).
Notis se bɔku nativ sɛlɛkɛt mɛnyu dɛn—dat na Safari ɛn Chrome—gɛt rawnd kɔna dɛn we dɛn nɔ go ebul fɔ chenj bay border-radius
prɔpati dɛn.
Fɔ <select>
kɔntrol dɛn wit di multiple
atribyut, dɛn de sho bɔku opshɔn dɛn bay difɔlt.
We yu nid fɔ put klin tɛks nia wan fɔm lɛbl insay wan fɔm, yuz di .form-control-static
klas we de na wan <p>
.
Wi de pul di difɔlt outline
stayl dɛn na sɔm fɔm kɔntrol dɛn ɛn aplay a box-shadow
insay in ples fɔ :focus
.
:focus
stetDi ɛgzampul input we de ɔp de yuz kɔstɔm stayl dɛn na wi dɔkyumentri fɔ sho di :focus
stet pan wan .form-control
.
Ad di disabled
boolean atribyut pan wan input fɔ mek yuz nɔ intarakshɔn. Di input dɛn we nɔ ebul fɔ wok de sho layt ɛn ad not-allowed
kɔsa.
Ad di disabled
atribyut to a <fieldset>
fɔ disable ɔl di kɔntrol dɛn insay di <fieldset>
wan tɛm.
<a>
Bay difɔlt, brawza dɛn go trit ɔl di nativ fɔm kɔntrol dɛn ( <input>
, <select>
ɛn <button>
ɛlimɛnt dɛn) insay a <fieldset disabled>
as disabled, we go mek ɔl tu di kibɔd ɛn maws intarakshɔn pan dɛn. Bɔt if yu fɔm gɛt <a ... class="btn btn-*">
ɛlimɛnt dɛn bak, dɛn go jɔs gi dɛn wan ya wan stayl we na pointer-events: none
. As wi bin dɔn tɔk na di sɛkshɔn bɔt disabled stet fɔ bɔtin dɛn (ɛn spɛshal wan na di sab-sɛkshɔn fɔ ankɔ ɛlimɛnt dɛn), dis CSS prɔpati nɔ standad yet ɛn i nɔ fulɔp fɔ sɔpɔt am na Opera 18 ɛn dɔŋ ya, ɔ na Intanɛt Ɛksplɔrɔ 11, ɛn i win 't fɔ mek di wan dɛn we de yuz di kibɔd nɔ ebul fɔ fos ɔ aktiv dɛn link dɛn ya. So fɔ mek yu sef, yuz kɔstɔm JavaSkript fɔ disable dɛn kayn link dɛn de.
Pan ɔl we Bootstrap go yuz dɛn stayl dɛn ya na ɔl di brawza dɛn, Intanɛt Ɛksplɔrɔ 11 ɛn dɔŋ ya nɔ de sɔpɔt di disabled
atribyut ɔlsay na wan <fieldset>
. Yuz kɔstɔm JavaSkript fɔ disable di fil sɛt na dɛn brɔuza dɛn ya.
Ad di readonly
boolean atribyut pan wan input fɔ mek dɛn nɔ chenj di input in valyu. Di input dɛn we yu kin rid nɔmɔ kin tan lɛk layt (jɔs lɛk di input dɛn we dɛn dɔn disable), bɔt dɛn kin kip di standad kɔsa.
Blɔk lɛvɛl ɛp tɛks fɔ fɔm kɔntrol dɛn.
Ɛp tɛks fɔ gɛt sɔntin fɔ du wit di fɔm kɔntrol we i gɛt fɔ du wit fɔ yuz di aria-describedby
atribyut. Dis go mek shɔ se ɛp tɛknɔlɔji dɛn – lɛk skrin rida dɛn – go anɔys dis ɛp tɛks we di pɔsin we de yuz am de pe atɛnshɔn ɔ go insay di kɔntrol.
Bootstrap inklud validɛshɔn stayl fɔ mistek, wɔnin, ɛn sakses stet dɛn pan fɔm kɔntrol dɛn. Fɔ yuz, ad .has-warning
, .has-error
, ɔ .has-success
to di mama ɛn papa ɛlimɛnt. Ɛni .control-label
, .form-control
, ɛn .help-block
insay da ɛlimɛnt de go gɛt di validɛshɔn stayl dɛn.
Yuz dɛn validɛshɔn stayl ya fɔ sho di stet fɔ wan fɔm kɔntrol de jɔs gi wan vijual, kɔlɔ-bɛs indikɛshɔn, we dɛn nɔ go gi to pipul dɛn we de yuz ɛtɛknɔlɔji dɛn we de ɛp - lɛk skrin rida dɛn - ɔ to pipul dɛn we de yuz kɔlɔ blaynd.
Mek shɔ se dɛn gi ɔda indikashɔn fɔ stet bak. Fɔ ɛgzampul, yu kin put hint bɔt stet insay di fɔm kɔntrol in <label>
tɛks sɛf (as i bi na di kɔd ɛgzampul we de kam biɛn), put wan Glifikɔn (wit di rayt ɔda tɛks we yu de yuz di .sr-only
klas - si di Glifikɔn ɛgzampul dɛn ), ɔ bay we yu gi wan adishɔnal ɛp tɛks blɔk. Speshal fɔ ɛp tɛnkɔlɔji dɛn, dɛn kin gi invalid fɔm kɔntrol dɛn bak wan aria-invalid="true"
atribyut.
Yu kin ad bak opshɔnal fidbak aykɔn dɛn wit di addɛshɔn fɔ .has-feedback
ɛn di rayt aykɔn.
Fidbak aykɔn dɛn jɔs de wok wit tɛkstual <input class="form-control">
ɛlimɛnt dɛn.
Manual posishun fɔ fidbak aykɔn dɛn nid fɔ input dɛn we nɔ gɛt lɛbl ɛn fɔ input grup dɛn we gɛt ad-ɔn na di rayt say. Wi de ɛnkɔrej yu tranga wan fɔ gi lɛbl fɔ ɔl di input dɛn fɔ rizin dɛn we gɛt fɔ du wit akses. If yu want fɔ mek dɛn nɔ sho di lɛbl dɛn, ayd dɛn wit di .sr-only
klas. If yu fɔ du witout lɛbl, ajɔst di top
valyu fɔ di fidbak aykɔn. Fɔ input grup dɛn, ajɔst di right
valyu to wan aprɔpriet piksɛl valyu dipen pan di wit fɔ yu adɔn.
Fɔ mek shɔ se di ɛtɛknɔlɔji dɛn we de ɛp – lɛk skrin rida dɛn – de sho di minin fɔ wan aykɔn kɔrɛkt wan, dɛn fɔ put ɔda tɛks we dɛn ayd wit di .sr-only
klas ɛn dɛn fɔ gɛt sɔntin fɔ du wit di fɔm kɔntrol we i gɛt fɔ du wit fɔ yuz aria-describedby
. Ɔda we de fɔ du dat, mek shɔ se dɛn gi di minin (fɔ ɛgzampul, di tru tin we se wɔnin de fɔ wan patikyula tɛks ɛntri fil) insay sɔm ɔda we, lɛk fɔ chenj di tɛks fɔ di aktual <label>
we gɛt fɔ du wit di fɔm kɔntrol.
Pan ɔl we di ɛgzampul dɛn we de kam biɛn ya dɔn ɔlrɛdi tɔk bɔt di validɛshɔn stet fɔ dɛn rispektiv fɔm kɔntrol dɛn na di <label>
tɛks sɛf, dɛn dɔn put di tɛknik we de ɔp (we de yuz .sr-only
tɛks ɛn aria-describedby
) fɔ sho.
.sr-only
lɛbl dɛn we dɛn aydIf yu yuz di .sr-only
klas fɔ ayd wan fɔm kɔntrol in <label>
(pas fɔ yuz ɔda lɛbul opshɔn dɛn, lɛk di aria-label
atribyut), Bootstrap go ɔtomɛtik ajɔst di pozishɔn fɔ di aykɔn wans dɛn dɔn ad am.
Sɛt ayt dɛn yuz klas dɛn lɛk .input-lg
, ɛn sɛt wid dɛn yuz grid kɔlɔm klas dɛn lɛk .col-lg-*
.
Krio fɔm kɔntrol dɛn we lɔng ɔ shɔt we de mach di bɔtin saiz dɛn.
Kwik kwik wan saiz lɛbl ɛn fɔm kɔntrol dɛn insay .form-horizontal
bay we yu ad .form-group-lg
ɔ .form-group-sm
.
Rap input dɛn insay grid kɔlɔm dɛn, ɔ ɛni kɔstɔm mama ɛn papa ɛlimɛnt, fɔ mek i izi fɔ ɛnfɔs di wit dɛn we yu want.
Yuz di bɔtin klas dɛn na wan <a>
, <button>
, ɔ <input>
ɛlimɛnt.
Pan ɔl we dɛn kin yuz bɔtin klas dɛn pan <a>
ɛn <button>
ɛlimɛnt dɛn, na <button>
ɛlimɛnt dɛn nɔmɔ dɛn de sɔpɔt insay wi nav ɛn navbar kɔmpɔnɛnt dɛn.
If dɛn yuz di <a>
ɛlimɛnt dɛn fɔ wok lɛk bɔtin dɛn – we de trig in-pej wok, pas fɔ go na ɔda dɔkyumɛnt ɔ sɛkshɔn insay di pej we de naw – dɛn fɔ gi dɛn bak wan we fit role="button"
.
As di bɛst we fɔ du tin, wi kin rili advays yu fɔ yuz di <button>
ɛlimɛnt ɛnitɛm we i pɔsibul fɔ mek shɔ se di krɔs-brawza rɛnda mach.
Pan ɔda tin dɛn, wan bɔg de na Fayafaks <30 we de mek wi nɔ ebul fɔ sɛt di line-height
of <input>
-based bɔtin dɛn, we de mek dɛn nɔ de mach di ayt we ɔda bɔtin dɛn gɛt na Fayafaks.
Yuz ɛni wan pan di bɔtin klas dɛn we de fɔ mek wan bɔtin we gɛt stayl kwik kwik wan.
Yuz kala fɔ ad minin to wan bɔtin de jɔs gi wan vishɔnal indikashɔn, we dɛn nɔ go gi to di wan dɛn we de yuz ɛtɛknɔlɔji dɛn we de ɛp – lɛk skrin rida dɛn. Mek shɔ se di infɔmeshɔn we dɛn sho wit di kɔlɔ kɔmɔt klia wan frɔm di tin dɛn we de insay insɛf (di tɛks we yu kin si na di bɔtin), ɔ dɛn put am insay ɔda we dɛn, lɛk ɔda tɛks we dɛn ayd wit di .sr-only
klas.
Fans big ɔ smɔl bɔtin dɛn? Ad .btn-lg
, .btn-sm
, ɔ .btn-xs
fɔ ɔda saiz dɛn.
Krio blɔk lɛvɛl bɔtin dɛn—di wan dɛn we de span di ful wit fɔ wan mama ɔ papa—bay we yu ad .btn-block
.
Bɔtin dɛn go apia we dɛn prɛs (wit bakgrɔn we dak, bɔda we dak, ɛn shado we dɛn put insay) we dɛn de wok. Fɔ <button>
ɛlimɛnt dɛn, dɛn kin du dis bay :active
. Fɔ <a>
ɛlimɛnt dɛn, dɛn dɔn du am wit .active
. Bɔt yu kin yuz .active
pan <button>
s (ɛn inklud di aria-pressed="true"
atribyut) if yu nid fɔ riplik di aktiv stet programmatik wan.
No nid fɔ ad :active
as na pseudo-klas, bɔt if yu nid fɔ fos di sem apinɛns, go bifo ɛn ad .active
.
Ad di .active
klas to di <a>
bɔtin dɛn.
Praymari link fɔ di wan dɛn we de Link
Mek di bɔtin dɛn luk lɛk se yu nɔ go ebul fɔ klik bay we yu de fad dɛn bak wit opacity
.
Ad di disabled
atribyut to di <button>
bɔtin dɛn.
If yu ad di disabled
atribyut to a <button>
, Intanɛt Ɛksplɔrɔ 9 ɛn dɔŋ ya go rɛnd tɛks grey wit wan bad bad tɛks-shado we wi nɔ go ebul fɔ fiks.
Ad di .disabled
klas to di <a>
bɔtin dɛn.
Praymari link fɔ di wan dɛn we de Link
Wi de yuz .disabled
as yutiliti klas ya, we fiba di kɔmɔn .active
klas, so dɛn nɔ nid fɔ gɛt prɛfiks.
Dis klas de yuz pointer-events: none
fɔ tray fɔ disable di link funkshɔnaliti fɔ <a>
s, bɔt da CSS prɔpati de nɔ standad yet ɛn i nɔ fulɔp fɔ sɔpɔt na Opera 18 ɛn dɔŋ, ɔ na Intanɛt Ɛksplɔrɔ 11. Apat frɔm dat, ivin na brawza dɛn we de sɔpɔt pointer-events: none
, kibɔd nevigishɔn stil nɔ afɛkt, we min se di wan dɛn we de si di kibɔd ɛn di wan dɛn we de yuz ɛtɛknɔlɔji dɛn we de ɛp go stil ebul fɔ aktiv dɛn link dɛn ya. So fɔ mek yu sef, yuz kɔstɔm JavaSkript fɔ disable dɛn kayn link dɛn de.
Imej dɛn na Bootstrap 3 kin mek dɛn ansa-frenli via di adishɔn fɔ di .img-responsive
klas. Dis de aplay max-width: 100%;
, height: auto;
ɛn display: block;
to di pikchɔ so dat i go skel fayn fayn wan to di mama ɛn papa ɛlimɛnt.
Fɔ sɛnt pikchɔ dɛn we de yuz di .img-responsive
klas, yuz .center-block
instead fɔ .text-center
. Si di ɛlda klas dɛn sɛkshɔn fɔ no mɔ bɔt aw fɔ .center-block
yuz am.
Insay Intanɛt Ɛksplɔrɔ 8-10, SVG pikchɔ dɛn wit .img-responsive
na disproportionately saiz. Fɔ fiks dis, ad width: 100% \9;
usay nid de. Bootstrap nɔ de aplay dis ɔtomɛtik as i de mek kɔmplikeshɔn to ɔda imej fɔmat dɛn.
Ad klas dɛn to wan <img>
ɛlimɛnt fɔ mek i izi fɔ stayl pikchɔ dɛn na ɛni prɔjek.
Kip in maynd se Intanɛt Ɛksplɔrɔ 8 nɔ gɛt sɔpɔt fɔ rawnd kɔna dɛn.
Kɔnvɛy minin tru kɔlɔ wit wan anful ɛmpɛshimɛnt yutiliti klas dɛm. Dɛn kin yuz dɛn tin ya bak fɔ link dɛn ɛn dɛn go dak we yu de hova jɔs lɛk wi difɔlt link stayl dɛn.
Fusce dapibus, tellus ac cursus komodo, tortor mauris nibh.
Nullam id dolor id nibh ultrisis vehikula ut id elit.
Duis mollis, est nɔ komodo luktɔs, nisi erat pɔtitɔ ligula.
Maecenas sed diam eget risus varius blandit sidɔm amet nɔ magna.
Etiam porta sem malesuada magna mollis yusmod.
Donec ullamcorper nulla non metus ɔktɔ fringila.
Sɔntɛnde, dɛn nɔ kin ebul fɔ yuz ɛmpɛshimɛnt klas dɛn bikɔs ɔf di spɛsifisiti fɔ ɔda sɛlɛktɔ. Bɔku tɛm, wan tin we go du fɔ sɔlv di prɔblɛm na fɔ rap yu tɛks insay wan <span>
wit di klas.
Yuz kala fɔ ad minin de jɔs gi wan vijual indikashɔn, we dɛn nɔ go gi to di wan dɛn we de yuz ɛtɛknɔlɔji dɛn we de ɛp – lɛk skrin rida dɛn. Mek shɔ se di infɔmeshɔn we dɛn sho wit di kɔlɔ, ɔl tu klia frɔm di tin we de insay insɛf (dɛn jɔs yuz di kɔntɛkstual kɔlɔ dɛn fɔ mek di minin we dɔn ɔlrɛdi de na di tɛks/mak strɔng), ɔ dɛn put am tru ɔda we dɛn, lɛk ɔda tɛks we dɛn ayd wit di .sr-only
klas .
Semweso lɛk di kɔntɛkstual tɛks kɔlɔ klas dɛn, izi fɔ sɛt di bakgrɔn fɔ wan ɛlimɛnt to ɛni kɔntɛkstual klas. Ankɔ kɔmpɔnɛnt dɛn go dak we yu de hova, jɔs lɛk di tɛks klas dɛn.
Nullam id dolor id nibh ultrisis vehikula ut id elit.
Duis mollis, est nɔ komodo luktɔs, nisi erat pɔtitɔ ligula.
Maecenas sed diam eget risus varius blandit sidɔm amet nɔ magna.
Etiam porta sem malesuada magna mollis yusmod.
Donec ullamcorper nulla non metus ɔktɔ fringila.
Sɔntɛnde, dɛn nɔ kin ebul fɔ yuz kɔntɛkstual bakgrɔn klas dɛn bikɔs ɔf di spɛsifisiti fɔ ɔda sɛlɛktɔ. Sɔntɛnde, wan naf wok-arawnd na fɔ rap yu ɛlimɛnt in kɔntinyu insay wan <div>
wit di klas.
As wit kɔntɛkstual kɔlɔ dɛn , mek shɔ se ɛni minin we dɛn gi tru kɔlɔ, dɛn de gi am bak insay wan fɔmat we nɔto jɔs prɛzɛntɛnshɔn.
Yuz di jenɛrik klos aykɔn fɔ dismis kɔntinyu lɛk modal ɛn alɛt.
Yuz karet fɔ sho aw di drɔpdɔwn de wok ɛn aw fɔ go. Notis se di difɔlt karet go rivɛns ɔtomɛtik wan na drɔp mɛnyu dɛn .
Flɔt wan ɛlimɛnt na di lɛft ɔ rayt wit wan klas. !important
na inklud fɔ avɔyd spɛsifisiti kwɛshɔn dɛn. Yu kin yuz klas dɛn bak as miksin.
Set wan elemɛnt to display: block
ɛn sɛnt via margin
. Available as wan mixin ɛn klas.
I izi fɔ klia float
s bay we yu ad .clearfix
to di mama ɛn papa ɛlimɛnt . Yutilayz di maykro kliafiks as Nicolas Gallagher bin pɔpul. Yu kin yuz am bak as mixin.
Fos wan ɛlimɛnt fɔ sho ɔ ayd ( inklud fɔ skrin rida dɛn ) wit di yus fɔ .show
ɛn .hidden
klas dɛn. Dɛn klas ya kin yuz !important
fɔ avɔyd spɛsifisiti kɔnflikt, jɔs lɛk di kwik flot dɛn . Dɛn jɔs de fɔ blɔk lɛvɛl toggling. Dɛn kin yuz dɛn bak as miksin.
.hide
de, bɔt i nɔ kin afɛkt di wan dɛn we de rid di skrin ɔltɛm ɛn dɛn nɔ de yuz am as of v3.0.1 . Yuz .hidden
ɔ .sr-only
insted.
Dɔn bak, .invisible
dɛn kin yuz am fɔ tɔgl ɔl di visibiliti fɔ wan ɛlimɛnt, we min se in display
nɔ chenj ɛn di ɛlimɛnt kin stil afɛkt di flɔ fɔ di dɔkyumɛnt.
Ayd wan ɛlimɛnt to ɔl divays dɛn pas skrin rida dɛn wit .sr-only
. Kɔmbayn .sr-only
wit .sr-only-focusable
fɔ sho di ɛlimɛnt bak we i de fɔs (ɛgz. bay wan yuza we de yuz kibɔd nɔmɔ). Nesesary fɔ fala aksesibiliti bɛst prɔsis . Yu kin yuz am bak as miksin.
Yuz di .text-hide
klas ɔ mixin fɔ ɛp fɔ riples wan ɛlimɛnt in tɛks kɔntinyu wit bakgrɔn pikchɔ.
Fɔ mek yu ebul fɔ divɛlɔp di mobayl kwik kwik wan, yuz dɛn yutiliti klas ya fɔ sho ɛn ayd kɔntinyu bay divays bay we yu yuz midia kwɛstyɔn. Dɔn bak, dɛn gɛt yutiliti klas dɛn fɔ chenj di tin dɛn we de insay we dɛn de print.
Tray fɔ yuz dɛn tin ya smɔl ɛn nɔ mek difrɛn difrɛn we dɛn fɔ di sem sayt. Bifo dat, yuz dɛn fɔ kɔmplit di prɛzɛntɛnshɔn we de na ɛni divays.
Yuz wan ɔ kɔmbaynshɔn fɔ di klas dɛn we de fɔ tɔgl kɔntinyu akɔdin to di viupɔt brekpɔynt dɛn.
Ekstra smɔl smɔl divays dɛnFɔn dɛn (<768px) | Smɔl smɔl tin dɛn we dɛn kin yuz fɔ mek tin dɛnTablɛt dɛn (≥768px) | Midul divays dɛnDɛsktɔp dɛn (≥992px) | Big big divays dɛnDɛsktɔp dɛn (≥1200px) | |
---|---|---|---|---|
.visible-xs-* |
Wi kin si am | Ayd | Ayd | Ayd |
.visible-sm-* |
Ayd | Wi kin si am | Ayd | Ayd |
.visible-md-* |
Ayd | Ayd | Wi kin si am | Ayd |
.visible-lg-* |
Ayd | Ayd | Ayd | Wi kin si am |
.hidden-xs |
Ayd | Wi kin si am | Wi kin si am | Wi kin si am |
.hidden-sm |
Wi kin si am | Ayd | Wi kin si am | Wi kin si am |
.hidden-md |
Wi kin si am | Wi kin si am | Ayd | Wi kin si am |
.hidden-lg |
Wi kin si am | Wi kin si am | Wi kin si am | Ayd |
As of v3.2.0, di .visible-*-*
klas dɛm fɔ ɛni brekpɔynt kam insay tri chenj dɛm, wan fɔ ɛni CSS display
prɔpati valyu we dɛn list dɔŋ ya.
Grup fɔ klas dɛn | CSS we dɛn kɔl CSSdisplay |
---|---|
.visible-*-block |
display: block; |
.visible-*-inline |
display: inline; |
.visible-*-inline-block |
display: inline-block; |
So, fɔ ɛkstra smɔl ( xs
) skrin dɛn fɔ ɛgzampul, di .visible-*-*
klas dɛn we de na: .visible-xs-block
, .visible-xs-inline
, ɛn .visible-xs-inline-block
.
Di klas dɛn .visible-xs
, .visible-sm
, .visible-md
, ɛn .visible-lg
dɛn de bak, bɔt dɛn nɔ de yuz am as of v3.2.0 . Dɛn na lɛk .visible-*-block
, pas wit ɔda spɛshal kes dɛn fɔ toggling <table>
-rilayt ɛlimɛnt dɛn.
Semweso lɛk di klas dɛn we de ansa ɔltɛm, yuz dɛn wan ya fɔ chenj di tin dɛn we de insay fɔ print.
Klas dɛn | Brawza fɔ yuz | Print we dɛn kin print |
---|---|---|
.visible-print-block .visible-print-inline .visible-print-inline-block |
Ayd | Wi kin si am |
.hidden-print |
Wi kin si am | Ayd |
Di klas .visible-print
de bak bɔt i dɔn deprɛkt am as of v3.2.0. I ikwal to .visible-print-block
, pas wit ɔda spɛshal kes dɛn fɔ <table>
-rilayt ɛlimɛnt dɛn.
Risayz yu brɔwza ɔ lod pan difrɛn divays dɛn fɔ tɛst di yutiliti klas dɛn we de ansa.
Grin chɛkmak dɛn de sho se di ɛlimɛnt de sho na di say we yu de si naw.
Na ya, grɛn chɛkmak dɛn de sho bak se di ɛlimɛnt ayd na yu viupɔt we yu de yuz naw.
Bootstrap in CSS na Less, wan prɛprosɛsɔ we gɛt ɔda wok dɛn lɛk vayriɔbul dɛn, miksin dɛn, ɛn fɛnshɔn dɛn fɔ kɔmpilayt CSS. Di wan dɛn we de luk fɔ yuz di sɔs Less fayl dɛn instead ɔf wi kɔmpilayt CSS fayl dɛn kin mek yus to di bɔku bɔku vɛriɔbul ɛn miksin dɛn we wi de yuz ɔlsay na di freym.
Grid vɛriɔbul ɛn miksin dɛn de kɔba insay di Grid sistɛm sɛkshɔn .
Yu kin yuz Bootstrap insay at le tu we dɛn: wit di CSS we dɛn dɔn kɔmpilayt ɔ wit di sɔs Less fayl dɛn. Fɔ kɔmpilayt di Less fayl dɛn, luk di Getting Started sɛkshɔn fɔ aw fɔ sɛtup yu divɛlɔpmɛnt ɛnvayrɔmɛnt fɔ rɔn di kɔmand dɛn we nid.
Tɔd pati kɔmpilayshɔn tul dɛn kin wok wit Bootstrap, bɔt wi kɔr tim nɔ de sɔpɔt dɛn.
Dɛn de yuz vayriɔbul dɛn ɔlsay na di wan ol prɔjek as we fɔ sɛntralayz ɛn sheb valyu dɛn we dɛn kin yuz ɔltɛm lɛk kɔlɔ, spɛshal, ɔ font stak. Fɔ si di kɔmplit brekdaun, duya luk di Customizer .
I izi fɔ mek yus to tu kɔlɔ skim dɛn: greyskel ɛn sɛmantik. Greyskayl kala dɛn de gi kwik akses to kɔmɔn yuz shed dɛn fɔ blak we sɛmantik inklud difrɛn kɔlɔ dɛn we dɛn asaynd to mininful kɔntɛkstual valyu dɛn.
Yuz ɛni wan pan dɛn kɔlɔ vɛriɔbul dɛn ya as dɛn de ɔ riasayn dɛn to mɔ mininful vɛriɔbul dɛn fɔ yu prɔjek.
Wan handful of variables fɔ kwik kwik wan kɔstɔmayz ki ɛlimɛnt dɛn na yu sayt in skel.
I izi fɔ stayl yu link dɛn wit di rayt kɔlɔ wit wan valyu nɔmɔ.
Notis se di @link-hover-color
yuz wan fɛnshɔn, ɔda wɔndaful tul frɔm Less, fɔ mek di rayt hova kɔlɔ ɔtomɛtik wan. Yu kin yuz darken
, lighten
, saturate
, ɛn desaturate
.
I izi fɔ sɛt yu taypfeys, tɛks saiz, lida, ɛn ɔda tin dɛn wit sɔm kwik vɛriɔbul dɛn. Bootstrap de mek yus to dɛn wan ya bak fɔ gi izi taypografik miksin dɛn.
Tu kwik variebul fɔ kɔstɔmayz di say ɛn fayl nem fɔ yu aykɔn dɛn.
Komponent dɛn ɔlsay na Bootstrap de mek yus to sɔm difɔlt vɛriɔbul dɛn fɔ sɛt kɔmɔn valyu dɛn. Na dɛn wan ya we dɛn kin yuz mɔ.
Vendor mixins na mixins fɔ ɛp fɔ sɔpɔt bɔku brawza dɛn bay we yu put ɔl di rilevɛn vendor prɛfiks dɛn na yu CSS we yu dɔn kɔmpilayt.
Riset yu komponent dɛn bɔks mɔdel wit wan singl mixin. Fɔ si di kɔntɛks, luk dis atikul we go ɛp yu frɔm Mozilla .
Di mixin na deprecated as of v3.2.0, wit di introdɔkshɔn fɔ Autoprefixer. Fɔ kip bak-kɔmpatibiliti, Bootstrap go kɔntinyu fɔ yuz di mixin insay te Bootstrap v4.
Tide ɔl di mɔdan brawza dɛn de sɔpɔt di border-radius
prɔpati we nɔ gɛt prɛfiks. As a so, no .border-radius()
mixin nɔ de, bɔt Bootstrap de inklud sɔtkat fɔ kwik kwik wan rawnd tu kɔna dɛn na wan patikyula say na wan tin.
If yu target ɔdiɛns de yuz di layt ɛn big big brɔuza ɛn divays dɛn, mek shɔ se yu jɔs yuz di box-shadow
prɔpati fɔ insɛf. If yu nid sɔpɔt fɔ ol Andrɔyd (pri-v4) ɛn iOS divays dɛn (pri-iOS 5), yuz di mixin we dɛn nɔ de yuz fɔ pik di wan dɛn we yu nid-webkit
prɛfiks we yu nid.
Di mixin na deprecated as of v3.1.0, bikɔs Bootstrap nɔ ɔfishal sɔpɔt di ɔtdɛt pletfɔm dɛn we nɔ sɔpɔt di standad prɔpati. Fɔ kip bak-kɔmpatibiliti, Bootstrap go kɔntinyu fɔ yuz di mixin insay te Bootstrap v4.
Mek shɔ se yu yuz rgba()
kɔlɔ dɛn na yu bɔks shado dɛn so dat dɛn go miks fayn fayn wan wit bakgrɔn dɛn.
Bɔku bɔku miksin dɛn fɔ mek yu ebul fɔ chenj. Sɛt ɔl di transishɔn infɔmeshɔn wit wan, ɔ sho wan sɛpret dilɛy ɛn di tɛm we yu fɔ tek as nid de.
Di miksin dɛn dɔn deprɛkt as fɔ v3.2.0, wit di introdɔkshɔn fɔ Ɔtoprɛfiksa. Fɔ kip bak-kɔmpatibiliti, Bootstrap go kɔntinyu fɔ yuz di mixins insay te Bootstrap v4.
Rotate, skel, translet (muv), ɔ skew ɛnitin.
Di miksin dɛn dɔn deprɛkt as fɔ v3.2.0, wit di introdɔkshɔn fɔ Ɔtoprɛfiksa. Fɔ kip bak-kɔmpatibiliti, Bootstrap go kɔntinyu fɔ yuz di mixins insay te Bootstrap v4.
Wan singl miksin fɔ yuz ɔl di CSS3 in animashɔn prɔpati dɛn na wan diklareshɔn ɛn ɔda miksin fɔ wan wan prɔpati dɛn.
Di miksin dɛn dɔn deprɛkt as fɔ v3.2.0, wit di introdɔkshɔn fɔ Ɔtoprɛfiksa. Fɔ kip bak-kɔmpatibiliti, Bootstrap go kɔntinyu fɔ yuz di mixins insay te Bootstrap v4.
Set di opasiti fɔ ɔl di brawza dɛn ɛn gi wan filter
fɔl bak fɔ IE8.
Gi kɔntɛks fɔ fɔm kɔntrol dɛn insay ɛni fil.
Jɛnɛret kɔlɔm dɛn via CSS insay wan singl ɛlimɛnt.
I izi fɔ tɔn ɛni tu kɔlɔ to bakgrɔn gradient. Gɛt mɔ advans ɛn sɛt wan dairekshɔn, yuz tri kɔlɔ dɛn, ɔ yuz wan raydial grɛdiɛnt. Wit wan single mixin yu get ol di prefixed syntax dem yu go nid.
Yu kin spɛsifa bak di angul fɔ wan standad tu-kɔlɔ, linya grɛdiɛnt:
If yu nid wan barber-stripe stayl gradient, dat izi, tu. Jɔs spɛsifa wan singl kɔlɔ ɛn wi go ɔvalayz wan translucent wayt strɛp.
Up di ante en yuz tri kala insted. Sɛt di fɔs kɔlɔ, di sɛkɔn kɔlɔ, di sɛkɔn kɔlɔ in kɔlɔ stɔp (wan pasɛnt valyu lɛk 25%), ɛn di tɔd kɔlɔ wit dɛn miksin ya:
Hed dɛn de ɔp! If yu ɛva nid fɔ pul wan gradient, mek shɔ se yu pul ɛni IE-spɛsifi k we filter
yu go dɔn ad. Yu kin du dat bay we yu yuz di .reset-filter()
mixin nia background-image: none;
.
Yutiliti miksin na miksin we de kam togɛda wit ɔda CSS prɔpati dɛn we nɔ gɛt natin fɔ du wit fɔ ajɔst wan patikyula gol ɔ wok.
Fɔgɛt fɔ ad class="clearfix"
to ɛni ɛlimɛnt ɛn insted ad di .clearfix()
miksin usay i fayn. Yuz di maykro kliafiks frɔm Nicolas Gallagher .
Kwik wan sɛnt ɛni ɛlimɛnt insay in mama ɔ papa. Rikways width
ɔ max-width
fɔ sɛt am.
Spɛsifikɛt di dimɛnshɔn dɛn fɔ wan tin izi wan.
I izi fɔ kɔnfigyut di sayz opshɔn dɛn fɔ ɛni tɛkseria, ɔ ɛni ɔda ɛlimɛnt. Difɔlt to nɔmal brawza bihayvya ( both
).
I izi fɔ trunkat tɛks wit wan ɛlipsis wit wan singl miksin. Rikways element fɔ bi block
ɔ inline-block
lɛvɛl.
Spɛsify tu imej pat ɛn di @1x imej dimɛnshɔn dɛn, ɛn Bootstrap go gi wan @2x midia kwɛstyɔn. If yu gɛt bɔku pikchɔ dɛn fɔ sav, tink bɔt fɔ rayt yu retina imej CSS wit yu an insay wan midia kwɛstyɔn.
Pan ɔl we dɛn bil Bootstrap pan Less, i gɛt ɔfishal Sass pɔt bak . Wi de mentɛn am na wan sɛpret GitHub ripɔsitɔri ɛn wi de handle ɔpdet dɛn wit wan kɔnvɛnshɔn skript.
Bikɔs di Sass pɔt gɛt wan sɛpret repo ɛn i de sav wan smɔl difrɛn ɔdiɛns, di tin dɛn we de insay di prɔjek difrɛn bad bad wan frɔm di men Bootstrap prɔjek. Dis de mek shɔ se di Sass pɔt kɔmpitabl wit bɔku Sass-based sistem dɛn as pɔsibul.
Rod | Tɔk bɔt |
---|---|
lib/ |
Rubi gem kod (Sass konfigyushɔn, Rel ɛn Kɔmpas intagreshɔn dɛn) |
tasks/ |
Kɔnvɔta skript dɛn (we de tɔn ɔpstrim Les to Sass) . |
test/ |
Kɔmpilayshɔn tɛst dɛn |
templates/ |
Kɔmpas paket manifest |
vendor/assets/ |
Sass, JavaSkript, ɛn font fayl dɛn |
Rakefile |
Intanɛnt wok dɛn, lɛk fɔ rayk ɛn kɔnvɔyt |
Visit di Sass pɔt in GitHub ripɔsitɔri fɔ si dɛn fayl dɛn ya de wok.
Fɔ no mɔ bɔt aw fɔ instɔl ɛn yuz Bootstrap fɔ Sass, luk di GitHub ripɔsitɔri readme . Na di sɔs we de ɔpdet pas ɔl ɛn i gɛt infɔmeshɔn fɔ yuz wit Rel, Kɔmpas, ɛn standad Sass prɔjek dɛn.