Ɔvaviu fɔ di Baybul

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.

HTML5 dɔktayp

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.

<!DOCTYPE html>
<html lang="en">
  ...
</html>

Mobayl fɔs

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>.

<meta name="viewport" content="width=device-width, initial-scale=1">

Yu kin disable di zooming kapabiliti dɛn na mobayl divays dɛn bay we yu ad user-scalable=noto 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!

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

Bootstrap de sɛt di bɛsis glob ɔl displei, taypografi, ɛn link stayl dɛn. Speshali, wi:

  • Set background-color: #fff;pan dibody
  • Yuz di @font-family-base, @font-size-base, ɛn @line-height-baseatribyut dɛn as wi taypografik bays
  • Set di global link kala via @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.

Nɔmalize.css

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 .

Kɔntena dɛn

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 .containerfɔ wan kɔntena we gɛt fiks wit we de ansa.

<div class="container">
  ...
</div>

Yuz .container-fluidfɔ wan ful wit kɔntena, we de span di wan ol wit fɔ yu viupɔt.

<div class="container-fluid">
  ...
</div>

Grid sistem

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 .

Sho

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:

  • Dɛn fɔ put di rɔw dɛn insay wan .container(fiks-wid) ɔ .container-fluid(ful-wid) fɔ mek dɛn alaynɛd ​​ɛn pad fayn fayn wan.
  • Yuz row fɔ mek ɔrizɔntal grup dɛn fɔ kɔlɔm dɛn.
  • Di tin dɛn we de insay fɔ de insay di kɔlɔm dɛn, ɛn na di kɔlɔm dɛn nɔmɔ kin bi di pikin dɛn we de na di row dɛn wantɛm wantɛm.
  • Pridifayn grid klas dɛn lɛk .rowɛn .col-xs-4de fɔ mek grid layout kwik kwik wan. Less mixins kin yuz bak fɔ mɔ sɛmantik layout dɛn.
  • Kɔlɔm dɛn kin mek gɔta (gap bitwin di tin dɛn we de insay di kɔlɔm) via padding. Dat padding de ofset in rows fɔ di fɔs ɛn las kɔlɔm via negatif margin pan .rows.
  • Di negatif margin na di rizin we mek di ɛgzampul dɛn we de dɔŋ ya autdent. Na so dat kɔntinyu insay grid kɔlɔm dɛn go layn wit kɔntinyu we nɔ de na grid.
  • Dɛn kin mek grid kɔlɔm dɛn bay we dɛn de sho di nɔmba fɔ di twɛlv kɔlɔm dɛn we de we yu want fɔ span. Fɔ ɛgzampul, tri ikwal kɔlɔm dɛn go yuz tri .col-xs-4.
  • 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.
  • Grid klas dɛn de aplay to divays dɛn we gɛt skrin wit we big pas ɔ ikwal to di brekpɔynt saiz dɛn, ɛn dɛn de ɔvalayz grid klas dɛn we dɛn de tɔch fɔ smɔl divays dɛn. So, eg fɔ yuz ɛni .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.

Midia kwɛstyɔn dɛn

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.

/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */

/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) { ... }

/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) { ... }

/* Large devices (large desktops, 1200px and up) */
@media (min-width: @screen-lg-min) { ... }

Wan wan tɛm wi kin ɛkspɛn pan dɛn midia kwɛstyɔn dɛn ya fɔ inklud wan max-widthfɔ stɔp CSS to wan smɔl sɛt fɔ divays dɛn.

@media (max-width: @screen-xs-max) { ... }
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { ... }
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) { ... }
@media (min-width: @screen-lg-min) { ... }

Grid opshɔn 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

Example: Stak-to-ɔrizɔntal

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.

.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-1
.kɔl-md-8
.kɔl-md-4
.kɔl-md-4
.kɔl-md-4
.kɔl-md-4
.kɔl-md-6
.kɔl-md-6
<div class="row">
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
</div>
<div class="row">
  <div class="col-md-8">.col-md-8</div>
  <div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
  <div class="col-md-6">.col-md-6</div>
  <div class="col-md-6">.col-md-6</div>
</div>

Example: Fluid kɔntena

Tɔn ɛni fiks-wid grid layout to ful-wid layout bay we yu chenj yu ɔda .containerwan to .container-fluid.

<div class="container-fluid">
  <div class="row">
    ...
  </div>
</div>

Example: Mobayl ɛn dɛsktɔp

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.

.kol-xs-12 .kol-md-8
.kol-xs-6 .kol-md-4
.kol-xs-6 .kol-md-4
.kol-xs-6 .kol-md-4
.kol-xs-6 .kol-md-4
.kɔl-xs-6
.kɔl-xs-6
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
  <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
<div class="row">
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

<!-- Columns are always 50% wide, on mobile and desktop -->
<div class="row">
  <div class="col-xs-6">.col-xs-6</div>
  <div class="col-xs-6">.col-xs-6</div>
</div>

Example: Mobayl, tablɛt, dɛsktɔp

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.

.kol-xs-12 .kol-sm-6 .kol-md-8
.kol-xs-6 .kol-md-4
.kol-xs-6 .kol-sm-4
.kol-xs-6 .kol-sm-4
.kol-xs-6 .kol-sm-4
<div class="row">
  <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row">
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  <!-- Optional: clear the XS cols if their content doesn't match in height -->
  <div class="clearfix visible-xs-block"></div>
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
</div>

Example: Kɔlɔm fɔ rap

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.

.kɔl-xs-9
.col-xs-4
Sins 9 + 4 = 13 > 12, dis 4-kכlכm-wayd div de gεt rap pan nyu layn as wan kכntigyu yunit.
.col-xs-6
Di kɔlɔm dɛn we de kam afta dat kɔntinyu fɔ de along di nyu layn.
<div class="row">
  <div class="col-xs-9">.col-xs-9</div>
  <div class="col-xs-4">.col-xs-4<br>Since 9 + 4 = 13 &gt; 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.</div>
  <div class="col-xs-6">.col-xs-6<br>Subsequent columns continue along the new line.</div>
</div>

Rispɔnsiv kɔlɔm dɛn de riset

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 .

.col-xs-6 .col-sm-3
Risayz yu viupɔt ɔ chɛk am na yu fon fɔ ɛgzampul.
.kol-xs-6 .kol-sm-3
.kol-xs-6 .kol-sm-3
.kol-xs-6 .kol-sm-3
<div class="row">
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>

  <!-- Add the extra clearfix for only the required viewport -->
  <div class="clearfix visible-xs-block"></div>

  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
</div>

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 .

<div class="row">
  <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
  <div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
</div>

<div class="row">
  <div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
  <div class="col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
</div>

Fɔ ɔfset kɔlɔm dɛn

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-4i de muv .col-md-4oba 4 kɔlɔm dɛn.

.kɔl-md-4
.kol-md-4 .kol-md-ɔfset-4
.kol-md-3 .kol-md-ɔfset-3
.kol-md-3 .kol-md-ɔfset-3
.kol-md-6 .kol-md-ɔfset-3
<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
</div>
<div class="row">
  <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
  <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
</div>
<div class="row">
  <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
</div>

Yu kin ɔvalayz ɔfset dɛn bak frɔm lɔwa grid taya dɛn wit .col-*-offset-0klas dɛn.

<div class="row">
  <div class="col-xs-6 col-sm-4">
  </div>
  <div class="col-xs-6 col-sm-4">
  </div>
  <div class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-0">
  </div>
</div>

Kɔlɔm dɛn we de mek dɛn nɛst

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).

Level 1: .kɔl-sm-9
Level 2: .kɔl-xs-8 .kɔl-sm-6
Level 2: .kɔl-xs-4 .kɔl-sm-6
<div class="row">
  <div class="col-sm-9">
    Level 1: .col-sm-9
    <div class="row">
      <div class="col-xs-8 col-sm-6">
        Level 2: .col-xs-8 .col-sm-6
      </div>
      <div class="col-xs-4 col-sm-6">
        Level 2: .col-xs-4 .col-sm-6
      </div>
    </div>
  </div>
</div>

Kɔlɔm fɔ ɔda

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.

.kol-md-9 .kol-md-push-3
.kol-md-3 .kol-md-pul-9
<div class="row">
  <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
  <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
</div>

Les miksin ɛn vɛriɔbul 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.

Di tin dɛn we kin chenj

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.

@grid-columns:              12;
@grid-gutter-width:         30px;
@grid-float-breakpoint:     768px;

Mixin dɛn

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.

// Creates a wrapper for a series of columns
.make-row(@gutter: @grid-gutter-width) {
  // Then clear the floated columns
  .clearfix();

  @media (min-width: @screen-sm-min) {
    margin-left:  (@gutter / -2);
    margin-right: (@gutter / -2);
  }

  // Negative margin nested rows out to align the content of columns
  .row {
    margin-left:  (@gutter / -2);
    margin-right: (@gutter / -2);
  }
}

// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @grid-float-breakpoint) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @screen-sm-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the small column offsets
.make-sm-column-offset(@columns) {
  @media (min-width: @screen-sm-min) {
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-sm-column-push(@columns) {
  @media (min-width: @screen-sm-min) {
    left: percentage((@columns / @grid-columns));
  }
}
.make-sm-column-pull(@columns) {
  @media (min-width: @screen-sm-min) {
    right: percentage((@columns / @grid-columns));
  }
}

// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @screen-md-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the medium column offsets
.make-md-column-offset(@columns) {
  @media (min-width: @screen-md-min) {
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-md-column-push(@columns) {
  @media (min-width: @screen-md-min) {
    left: percentage((@columns / @grid-columns));
  }
}
.make-md-column-pull(@columns) {
  @media (min-width: @screen-md-min) {
    right: percentage((@columns / @grid-columns));
  }
}

// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @screen-lg-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the large column offsets
.make-lg-column-offset(@columns) {
  @media (min-width: @screen-lg-min) {
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-lg-column-push(@columns) {
  @media (min-width: @screen-lg-min) {
    left: percentage((@columns / @grid-columns));
  }
}
.make-lg-column-pull(@columns) {
  @media (min-width: @screen-lg-min) {
    right: percentage((@columns / @grid-columns));
  }
}

Ɛgzampul aw fɔ yuz am

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.

.wrapper {
  .make-row();
}
.content-main {
  .make-lg-column(8);
}
.content-secondary {
  .make-lg-column(3);
  .make-lg-column-offset(1);
}
<div class="wrapper">
  <div class="content-main">...</div>
  <div class="content-secondary">...</div>
</div>

Taypografi

Di edlayn dɛn

Ɔl di HTML ɛd dɛn, <h1>te to <h6>, de. .h1tru .h6klas 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
<h1>h1. Bootstrap heading</h1>
<h2>h2. Bootstrap heading</h2>
<h3>h3. Bootstrap heading</h3>
<h4>h4. Bootstrap heading</h4>
<h5>h5. Bootstrap heading</h5>
<h6>h6. Bootstrap heading</h6>

Krio layt, sɛkɔndari tɛks insay ɛni edlayn wit wan jenɛrik <small>tag ɔ di .smallklas.

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
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<h2>h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>

Bɔdi kɔpi

Bootstrap in glob ɔl difɔlt font-sizena 14px , wit wan line-heightwe 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.

<p>...</p>

Lid bɔdi kɔpi

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.

<p class="lead">...</p>

Dɛn bil am wit Less

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.

Inlayn tɛks ɛlimɛnt dɛn

Tɛks we dɛn mak

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.

You can use the mark tag to <mark>highlight</mark> text.

Dilit tɛ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.

<del>This line of text is meant to be treated as deleted text.</del>

Strik tru tɛks

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.

<s>This line of text is meant to be treated as no longer accurate.</s>

Di tɛks we dɛn dɔn put insay

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.

<ins>This line of text is meant to be treated as an addition to the document.</ins>

Di tɛks we dɛn ɔndalayn

Fɔ ɔndalayn tɛks yuz di <u>tag.

Dis layn fɔ di tɛks go rɛnd lɛk aw dɛn ɔndalayn am

<u>This line of text will render as underlined</u>

Mek yus to HTML in difɔlt ɛmpɛshmɛnt tɛg dɛn wit laytwɛt stayl dɛn.

Smɔl tɛks

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-sizefɔ nɛst <small>ɛlimɛnt dɛn.

Yu kin yuz wan inlayn ɛlimɛnt ɔda we wit .smallin ples fɔ ɛni <small>.

Dis layn fɔ di tɛks dɛn min fɔ trit am lɛk fayn print.

<small>This line of text is meant to be treated as fine print.</small>

Gɛt maynd

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 .

<strong>rendered as bold text</strong>

Italik dɛn we dɛn rayt

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 .

<em>rendered as italicized text</em>

Ɔltɛrnativ ɛlimɛnt dɛn

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.

Alaynɛshɔn klas 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.

<p class="text-left">Left aligned text.</p>
<p class="text-center">Center aligned text.</p>
<p class="text-right">Right aligned text.</p>
<p class="text-justify">Justified text.</p>
<p class="text-nowrap">No wrap text.</p>

Transfɔmeshɔn klas dɛn

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.

<p class="text-lowercase">Lowercased text.</p>
<p class="text-uppercase">Uppercased text.</p>
<p class="text-capitalize">Capitalized text.</p>

Di tin dɛn we dɛn kin yuz fɔ shɔt

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 titleatribyut 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.

Besik abrɛvieshɔn

Wan shɔt we fɔ di wɔd atribyut na attr .

<abbr title="attribute">attr</abbr>

Initialism fɔ di fɔs pɔsin

Ad .initialismto wan abrevieshɔn fɔ wan smɔl font-sayz.

HTML na di bes tin sins slais bred.

<abbr title="HyperText Markup Language" class="initialism">HTML</abbr>

Adrɛs dɛn

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>.

Twitter, Inc.
1355 Maket Strit, Suit 900
San Fransisko, CA 94103
P: (123) 456-7890
Ful Nem
fɔs.last@ɛgzampul.com
<address>
  <strong>Twitter, Inc.</strong><br>
  1355 Market Street, Suite 900<br>
  San Francisco, CA 94103<br>
  <abbr title="Phone">P:</abbr> (123) 456-7890
</address>

<address>
  <strong>Full Name</strong><br>
  <a href="mailto:#">[email protected]</a>
</address>

Blɔkkɔt dɛn

Fɔ kot blɔk dɛn fɔ kɔntinyu frɔm ɔda sɔs insay yu dɔkyumɛnt.

Difɔlt blɔkkɔt

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.

<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
</blockquote>

Blɔkkɔt opshɔn dɛn

Stayl ɛn kɔntinyu chenj fɔ simpul chenj dɛn pan wan standad <blockquote>.

Fɔ gi nem to wan sɔs

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.

Sɔmbɔdi we gɛt nem na Sos Taytul
<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
  <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>

Ɔda displei dɛn

Ad .blockquote-reversefɔ wan blɔkkɔt wit kɔntinyu we dɛn alaynɛd ​​rayt.

Lorem ipsum dolor sidon amet, konsektetur adipissing elit. Intaj posuere erat wan ante.

Sɔmbɔdi we gɛt nem na Sos Taytul
<blockquote class="blockquote-reverse">
  ...
</blockquote>

List dɛn

Nɔ ɔda ɔda tin dɛn

Wan list fɔ di tin dɛn we di ɔda nɔ impɔtant klia wan.

  • Lorem ipsum dolor sidon amet
  • Konsectetur adipiscing elit we de na di bɔdi
  • Integer molestie lorem na massa
  • Fasilisis in prɛtiɔm nisl alikɛt
  • Nulla volutpat alikɔm velit
    • Fasɛl iakulis nɛk
    • Purus sodales di wan dɛn we de bɔn
    • Vestibulum laoreet pɔtitɔr sem
    • A tristik libero volutpat na
  • Faucibus porta lakus fringila vel
  • Aenean sidon amet erat nunc
  • Eget porttitor lorem we yu de du
<ul>
  <li>...</li>
</ul>

Dɛn dɔn ɔda am

Wan list fɔ di tin dɛn we di ɔda impɔtant klia wan.

  1. Lorem ipsum dolor sidon amet
  2. Konsectetur adipiscing elit we de na di bɔdi
  3. Integer molestie lorem na massa
  4. Fasilisis in prɛtiɔm nisl alikɛt
  5. Nulla volutpat alikɔm velit
  6. Faucibus porta lakus fringila vel
  7. Aenean sidon amet erat nunc
  8. Eget porttitor lorem we yu de du
<ol>
  <li>...</li>
</ol>

Nɔ stayl

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.

  • Lorem ipsum dolor sidon amet
  • Konsectetur adipiscing elit we de na di bɔdi
  • Integer molestie lorem na massa
  • Fasilisis in prɛtiɔm nisl alikɛt
  • Nulla volutpat alikɔm velit
    • Fasɛl iakulis nɛk
    • Purus sodales di wan dɛn we de bɔn
    • Vestibulum laoreet pɔtitɔr sem
    • A tristik libero volutpat na
  • Faucibus porta lakus fringila vel
  • Aenean sidon amet erat nunc
  • Eget porttitor lorem we yu de du
<ul class="list-unstyled">
  <li>...</li>
</ul>

Inlayn

Put ɔl di list tin dɛn na wan layn wit display: inline-block;ɛn sɔm layt pad.

  • Lorem ipsum we de na di wɔl
  • Faselɔs iakulis we de na di bɔdi
  • Nulla volutpat fɔ di wan dɛn we de
<ul class="list-inline">
  <li>...</li>
</ul>

Tɔk bɔt

Wan list fɔ di wɔd dɛn wit di diskripshɔn dɛn we gɛt fɔ du wit dɛn.

Diskripshɔn list dɛn
Wan diskripshɔn list fayn fɔ difayn wɔd dɛn.
Yuismod bin de
Vestibulum id ligula porta felis yuismod semper eget lasinia odio sem nec elit.
Donec id elit non mi porta gravida na eget metus.
Malesuada we de na di wɔl
Etiam porta sem malesuada magna mollis yusmod.
<dl>
  <dt>...</dt>
  <dd>...</dd>
</dl>

Ɔrizɔntal diskripshɔ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.

Diskripshɔn list dɛn
Wan diskripshɔn list fayn fɔ difayn wɔd dɛn.
Yuismod bin de
Vestibulum id ligula porta felis yuismod semper eget lasinia odio sem nec elit.
Donec id elit non mi porta gravida na eget metus.
Malesuada we de na di wɔl
Etiam porta sem malesuada magna mollis yusmod.
Felis euismod semper eget lasinia
Fusce dapibus, tellus ac cursus commodo, tortor mauris kondimɛnt nibh, ut fɛmintɔm massa jɔs sidɔm amet risus.
<dl class="dl-horizontal">
  <dt>...</dt>
  <dd>...</dd>
</dl>

Ɔto-trunkatin fɔ du

Ɔ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.

Kɔd fɔ di Baybul

Inlayn

Rap inlayn snipet dɛn fɔ kɔd wit <code>.

Fɔ ɛgzampul, <section>dɛn fɔ rap am as inlayn.
For example, <code>&lt;section&gt;</code> should be wrapped as inline.

Input fɔ yuz am

Yuz di <kbd>fɔ sho input we dɛn kin yuz kibɔd.

Fɔ chenj di dairektrɔ dɛn, rayt cddi nem fɔ di dairektrɔ afta dat.
Fɔ ɛdit di sɛtin dɛn, prɛs ctrl + ,
To switch directories, type <kbd>cd</kbd> followed by the name of the directory.<br>
To edit settings, press <kbd><kbd>ctrl</kbd> + <kbd>,</kbd></kbd>

Besik blɔk

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>
<pre>&lt;p&gt;Sample text here...&lt;/p&gt;</pre>

Yu kin opshɔn fɔ ad di.pre-scrollable klas, we go sɛt maks-ayt fɔ 350px ɛn gi yu y-aks skrolba.

Di tin dɛn we kin chenj

Fɔ sho di vayriɔbul dɛn yuz di <var>tag.

y = m x + b ɛn b

<var>y</var> = <var>m</var><var>x</var> + <var>b</var>

Sampul autput

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.

<samp>This text is meant to be treated as sample output from a computer program.</samp>

Tebul dɛn

Besik ɛgzampul

Fɔ di bɛsis stayl—layt pad ɛn jɔs ɔrizɔntal divayda dɛn—ad di bays klas .tableto ɛ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.

Opshɔnal tebul kapshɔ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
<table class="table">
  ...
</table>

Row dɛn we gɛt strɛp

Yuz .table-stripedfɔ ad zibra-strip to ɛni tebul row insay di <tbody>.

Krɔs-brauza kɔmpitibliti

Dɛn kin mek di tebul dɛn we gɛt strɛp bay di :nth-childCSS 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
<table class="table table-striped">
  ...
</table>

Tebul we gɛt bɔda

Ad .table-borderedfɔ 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
<table class="table table-bordered">
  ...
</table>

Hova row dɛn

Add .table-hoverfɔ ɛ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
<table class="table table-hover">
  ...
</table>

Tebul we dɛn dɔn kɔndɛns

Ad .table-condensedfɔ 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
<table class="table table-condensed">
  ...
</table>

Klas dɛn we de tɔk bɔt di kɔntɛks

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
<!-- On rows -->
<tr class="active">...</tr>
<tr class="success">...</tr>
<tr class="warning">...</tr>
<tr class="danger">...</tr>
<tr class="info">...</tr>

<!-- On cells (`td` or `th`) -->
<tr>
  <td class="active">...</td>
  <td class="success">...</td>
  <td class="warning">...</td>
  <td class="danger">...</td>
  <td class="info">...</td>
</tr>

Fɔ gi minin to ɛtɛknɔlɔji dɛn we de ɛp

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-onlyklas.

Tebul dɛn we de ansa

Krio tebul dɛn we de ansa bay we yu rap ɛni wan .tablepan dɛn .table-responsivefɔ 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.

Vɛtikal klipin/trɔnkɛshɔn

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 ɛn fil sɛt dɛn

Fayafaks gɛt sɔm awkward fil sɛt stayl we involv widthwe 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:

@-moz-document url-prefix() {
  fieldset { display: table-cell; }
}

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
<div class="table-responsive">
  <table class="table">
    ...
  </table>
</div>

Fɔm dɛn

Besik ɛgzampul

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-controldɛn dɔn sɛt to width: 100%;bay difɔlt. Rap lɛbl ɛn kɔntrol dɛn insay .form-groupfɔ mek yu gɛt di bɛst spɛshal say.

Ɛgzampul blɔk-lɛvel ɛp tɛks ya.

<form>
  <div class="form-group">
    <label for="exampleInputEmail1">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
  </div>
  <div class="form-group">
    <label for="exampleInputFile">File input</label>
    <input type="file" id="exampleInputFile">
    <p class="help-block">Example block-level help text here.</p>
  </div>
  <div class="checkbox">
    <label>
      <input type="checkbox"> Check me out
    </label>
  </div>
  <button type="submit" class="btn btn-default">Submit</button>
</form>

Nɔ miks fɔm grup dɛn wit input grup dɛn

Nɔ miks fɔm grup dɛn dairekt wit input grup dɛn . Bifo dat, nest di input grup insay di fɔm grup.

Fɔm we de insay di layn

Ad .form-inlineto 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.

I kin nid fɔ gɛt kɔstɔm wit dɛn

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.

Ɔltɛm yu fɔ ad lɛbl 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-onlyklas. Ɔda we dɛn de fɔ gi lɛbl fɔ ɛp tɛknɔlɔji dɛn, lɛk di aria-label, aria-labelledbyɔ titleatribyut. If nɔ pan dɛn tin ya nɔ de, di wan dɛn we de rid di skrin kin yuz di placeholderatribyut, if i de, bɔt notis se placeholderdɛn nɔ advays fɔ yuz am as ples fɔ ɔda we dɛn fɔ lɛbul.

<form class="form-inline">
  <div class="form-group">
    <label for="exampleInputName2">Name</label>
    <input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe">
  </div>
  <div class="form-group">
    <label for="exampleInputEmail2">Email</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="[email protected]">
  </div>
  <button type="submit" class="btn btn-default">Send invitation</button>
</form>
<form class="form-inline">
  <div class="form-group">
    <label class="sr-only" for="exampleInputEmail3">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail3" placeholder="Email">
  </div>
  <div class="form-group">
    <label class="sr-only" for="exampleInputPassword3">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword3" placeholder="Password">
  </div>
  <div class="checkbox">
    <label>
      <input type="checkbox"> Remember me
    </label>
  </div>
  <button type="submit" class="btn btn-default">Sign in</button>
</form>
$
.00 fɔ di wan dɛn we de
<form class="form-inline">
  <div class="form-group">
    <label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
    <div class="input-group">
      <div class="input-group-addon">$</div>
      <input type="text" class="form-control" id="exampleInputAmount" placeholder="Amount">
      <div class="input-group-addon">.00</div>
    </div>
  </div>
  <button type="submit" class="btn btn-primary">Transfer cash</button>
</form>

Ɔrizɔntal fɔm

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-horizontalto di fɔm (we nɔ nid fɔ bi wan <form>). We yu du dat, i de chenj .form-groups fɔ biev lɛk grid rɔw, so nɔ nid fɔ .row.

<form class="form-horizontal">
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
    <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        <label>
          <input type="checkbox"> Remember me
        </label>
      </div>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">Sign in</button>
    </div>
  </div>
</form>

Kɔntrol dɛn we dɛn sɔpɔt

Ɛgzampul dɛn fɔ standad fɔm kɔntrol dɛn we dɛn sɔpɔt insay wan ɛgzampul fɔm layout.

Di tin dɛn we dɛn kin put insay

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.

Tayp diklareshɔn nid fɔ de

Input dɛn go jɔs ful-ɔp wit stayl if dɛn typedeklare dɛn fayn fayn wan.

<input type="text" class="form-control" placeholder="Text input">

Input grup dɛn

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 .

Teks eria

Fɔm kɔntrol we de sɔpɔt bɔku layn dɛn na tɛks. Chenj rowsatribyut as nid de.

<textarea class="form-control" rows="3"></textarea>

Chɛkbɔks dɛn ɛn redio dɛn

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 .disabledklas to di mama ɔ papa .radio, .radio-inline, .checkbox, ɔ .checkbox-inline.

Difɔlt (we dɛn dɔn stak) .


<div class="checkbox">
  <label>
    <input type="checkbox" value="">
    Option one is this and that&mdash;be sure to include why it's great
  </label>
</div>
<div class="checkbox disabled">
  <label>
    <input type="checkbox" value="" disabled>
    Option two is disabled
  </label>
</div>

<div class="radio">
  <label>
    <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
    Option one is this and that&mdash;be sure to include why it's great
  </label>
</div>
<div class="radio">
  <label>
    <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
    Option two can be something else and selecting it will deselect option one
  </label>
</div>
<div class="radio disabled">
  <label>
    <input type="radio" name="optionsRadios" id="optionsRadios3" value="option3" disabled>
    Option three is disabled
  </label>
</div>

Inlayn chɛkbɔks ɛn redio dɛn

Yuz di .checkbox-inlineɔ .radio-inlineklas dɛn na wan siriɔs chɛkbɔks ɔ redio fɔ kɔntrol dɛn we de apia na di sem layn.


<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>
<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox2" value="option2"> 2
</label>
<label class="checkbox-inline">
  <input type="checkbox" id="inlineCheckbox3" value="option3"> 3
</label>

<label class="radio-inline">
  <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> 1
</label>
<label class="radio-inline">
  <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> 2
</label>
<label class="radio-inline">
  <input type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3"> 3
</label>

Chɛkbɔks ɛn redio dɛn we nɔ gɛt lɛbl tɛks

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).

<div class="checkbox">
  <label>
    <input type="checkbox" id="blankCheckbox" value="option1" aria-label="...">
  </label>
</div>
<div class="radio">
  <label>
    <input type="radio" name="blankRadio" id="blankRadio1" value="option1" aria-label="...">
  </label>
</div>

Di wan dɛn we de pik

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-radiusprɔpati dɛn.

<select class="form-control">
  <option>1</option>
  <option>2</option>
  <option>3</option>
  <option>4</option>
  <option>5</option>
</select>

<select>kɔntrol dɛn wit di multipleatribyut, dɛn de sho bɔku opshɔn dɛn bay difɔlt.

<select multiple class="form-control">
  <option>1</option>
  <option>2</option>
  <option>3</option>
  <option>4</option>
  <option>5</option>
</select>

Statik kɔntrol

We yu nid fɔ put klin tɛks nia wan fɔm lɛbl insay wan fɔm, yuz di .form-control-staticklas we de na wan <p>.

imel@ɛgzampul.com

<form class="form-horizontal">
  <div class="form-group">
    <label class="col-sm-2 control-label">Email</label>
    <div class="col-sm-10">
      <p class="form-control-static">[email protected]</p>
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword" class="col-sm-2 control-label">Password</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword" placeholder="Password">
    </div>
  </div>
</form>

imel@ɛgzampul.com

<form class="form-inline">
  <div class="form-group">
    <label class="sr-only">Email</label>
    <p class="form-control-static">[email protected]</p>
  </div>
  <div class="form-group">
    <label for="inputPassword2" class="sr-only">Password</label>
    <input type="password" class="form-control" id="inputPassword2" placeholder="Password">
  </div>
  <button type="submit" class="btn btn-default">Confirm identity</button>
</form>

Fokus stet

Wi de pul di difɔlt outlinestayl dɛn na sɔm fɔm kɔntrol dɛn ɛn aplay a box-shadowinsay in ples fɔ :focus.

Demo :focusstet

Di ɛgzampul input we de ɔp de yuz kɔstɔm stayl dɛn na wi dɔkyumentri fɔ sho di :focusstet pan wan .form-control.

Disabled stet

Ad di disabledboolean 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-allowedkɔsa.

<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>

Fild sɛt dɛn we nɔ ebul fɔ wok

Ad di disabledatribyut to a <fieldset>fɔ disable ɔl di kɔntrol dɛn insay di <fieldset>wan tɛm.

Caveat bɔt link funkshɔnaliti fɔ<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.

Krɔs-brauza kɔmpitibliti

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 disabledatribyut ɔlsay na wan <fieldset>. Yuz kɔstɔm JavaSkript fɔ disable di fil sɛt na dɛn brɔuza dɛn ya.

<form>
  <fieldset disabled>
    <div class="form-group">
      <label for="disabledTextInput">Disabled input</label>
      <input type="text" id="disabledTextInput" class="form-control" placeholder="Disabled input">
    </div>
    <div class="form-group">
      <label for="disabledSelect">Disabled select menu</label>
      <select id="disabledSelect" class="form-control">
        <option>Disabled select</option>
      </select>
    </div>
    <div class="checkbox">
      <label>
        <input type="checkbox"> Can't check this
      </label>
    </div>
    <button type="submit" class="btn btn-primary">Submit</button>
  </fieldset>
</form>

Rid nɔmɔ stet

Ad di readonlyboolean 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.

<input class="form-control" type="text" placeholder="Readonly input here…" readonly>

Ɛp tɛks

Blɔk lɛvɛl ɛp tɛks fɔ fɔm kɔntrol dɛn.

Fɔ jɔyn ɛp tɛks wit 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-describedbyatribyut. 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.

Wan blɔk we gɛt ɛp tɛks we de brok pan nyu layn ɛn we kin go pas wan layn.
<label class="sr-only" for="inputHelpBlock">Input with help text</label>
<input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock">
...
<span id="helpBlock" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>

Validɛshɔn stet dɛn

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-successto di mama ɛn papa ɛlimɛnt. Ɛni .control-label, .form-control, ɛn .help-blockinsay da ɛlimɛnt de go gɛt di validɛshɔn stayl dɛn.

Kɔnvɛy validɛshɔn stet to ɛp tɛknɔlɔji ɛn kɔla blaynd yuza 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-onlyklas - 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.

Wan blɔk we gɛt ɛp tɛks we de brok pan nyu layn ɛn we kin go pas wan layn.
<div class="form-group has-success">
  <label class="control-label" for="inputSuccess1">Input with success</label>
  <input type="text" class="form-control" id="inputSuccess1" aria-describedby="helpBlock2">
  <span id="helpBlock2" class="help-block">A block of help text that breaks onto a new line and may extend beyond one line.</span>
</div>
<div class="form-group has-warning">
  <label class="control-label" for="inputWarning1">Input with warning</label>
  <input type="text" class="form-control" id="inputWarning1">
</div>
<div class="form-group has-error">
  <label class="control-label" for="inputError1">Input with error</label>
  <input type="text" class="form-control" id="inputError1">
</div>
<div class="has-success">
  <div class="checkbox">
    <label>
      <input type="checkbox" id="checkboxSuccess" value="option1">
      Checkbox with success
    </label>
  </div>
</div>
<div class="has-warning">
  <div class="checkbox">
    <label>
      <input type="checkbox" id="checkboxWarning" value="option1">
      Checkbox with warning
    </label>
  </div>
</div>
<div class="has-error">
  <div class="checkbox">
    <label>
      <input type="checkbox" id="checkboxError" value="option1">
      Checkbox with error
    </label>
  </div>
</div>

Wit aykɔn dɛn we yu kin pik

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.

Aykɔn dɛn, lɛbl dɛn, ɛn input grup 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-onlyklas. If yu fɔ du witout lɛbl, ajɔst di topvalyu fɔ di fidbak aykɔn. Fɔ input grup dɛn, ajɔst di rightvalyu to wan aprɔpriet piksɛl valyu dipen pan di wit fɔ yu adɔn.

Fɔ gi di aykɔn in minin to ɛtɛknɔlɔji dɛn we de ɛp

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-onlyklas ɛ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-onlytɛks ɛn aria-describedby) fɔ sho.

(go bifo)
(wɔnin)
(mistek)
@
(go bifo)
<div class="form-group has-success has-feedback">
  <label class="control-label" for="inputSuccess2">Input with success</label>
  <input type="text" class="form-control" id="inputSuccess2" aria-describedby="inputSuccess2Status">
  <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
  <span id="inputSuccess2Status" class="sr-only">(success)</span>
</div>
<div class="form-group has-warning has-feedback">
  <label class="control-label" for="inputWarning2">Input with warning</label>
  <input type="text" class="form-control" id="inputWarning2" aria-describedby="inputWarning2Status">
  <span class="glyphicon glyphicon-warning-sign form-control-feedback" aria-hidden="true"></span>
  <span id="inputWarning2Status" class="sr-only">(warning)</span>
</div>
<div class="form-group has-error has-feedback">
  <label class="control-label" for="inputError2">Input with error</label>
  <input type="text" class="form-control" id="inputError2" aria-describedby="inputError2Status">
  <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
  <span id="inputError2Status" class="sr-only">(error)</span>
</div>
<div class="form-group has-success has-feedback">
  <label class="control-label" for="inputGroupSuccess1">Input group with success</label>
  <div class="input-group">
    <span class="input-group-addon">@</span>
    <input type="text" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status">
  </div>
  <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
  <span id="inputGroupSuccess1Status" class="sr-only">(success)</span>
</div>

Opshɔnal aykɔn dɛn insay ɔrizɔntal ɛn inlayn fɔm dɛn

(go bifo)
@
(go bifo)
<form class="form-horizontal">
  <div class="form-group has-success has-feedback">
    <label class="control-label col-sm-3" for="inputSuccess3">Input with success</label>
    <div class="col-sm-9">
      <input type="text" class="form-control" id="inputSuccess3" aria-describedby="inputSuccess3Status">
      <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
      <span id="inputSuccess3Status" class="sr-only">(success)</span>
    </div>
  </div>
  <div class="form-group has-success has-feedback">
    <label class="control-label col-sm-3" for="inputGroupSuccess2">Input group with success</label>
    <div class="col-sm-9">
      <div class="input-group">
        <span class="input-group-addon">@</span>
        <input type="text" class="form-control" id="inputGroupSuccess2" aria-describedby="inputGroupSuccess2Status">
      </div>
      <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
      <span id="inputGroupSuccess2Status" class="sr-only">(success)</span>
    </div>
  </div>
</form>
(go bifo)

@
(go bifo)
<form class="form-inline">
  <div class="form-group has-success has-feedback">
    <label class="control-label" for="inputSuccess4">Input with success</label>
    <input type="text" class="form-control" id="inputSuccess4" aria-describedby="inputSuccess4Status">
    <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
    <span id="inputSuccess4Status" class="sr-only">(success)</span>
  </div>
</form>
<form class="form-inline">
  <div class="form-group has-success has-feedback">
    <label class="control-label" for="inputGroupSuccess3">Input group with success</label>
    <div class="input-group">
      <span class="input-group-addon">@</span>
      <input type="text" class="form-control" id="inputGroupSuccess3" aria-describedby="inputGroupSuccess3Status">
    </div>
    <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
    <span id="inputGroupSuccess3Status" class="sr-only">(success)</span>
  </div>
</form>

Opshɔnal aykɔn dɛn wit .sr-onlylɛbl dɛn we dɛn ayd

If yu yuz di .sr-onlyklas fɔ ayd wan fɔm kɔntrol in <label>(pas fɔ yuz ɔda lɛbul opshɔn dɛn, lɛk di aria-labelatribyut), Bootstrap go ɔtomɛtik ajɔst di pozishɔn fɔ di aykɔn wans dɛn dɔn ad am.

(go bifo)
@
(go bifo)
<div class="form-group has-success has-feedback">
  <label class="control-label sr-only" for="inputSuccess5">Hidden label</label>
  <input type="text" class="form-control" id="inputSuccess5" aria-describedby="inputSuccess5Status">
  <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
  <span id="inputSuccess5Status" class="sr-only">(success)</span>
</div>
<div class="form-group has-success has-feedback">
  <label class="control-label sr-only" for="inputGroupSuccess4">Input group with success</label>
  <div class="input-group">
    <span class="input-group-addon">@</span>
    <input type="text" class="form-control" id="inputGroupSuccess4" aria-describedby="inputGroupSuccess4Status">
  </div>
  <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
  <span id="inputGroupSuccess4Status" class="sr-only">(success)</span>
</div>

Kɔntrol di sayz we dɛn de mek

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-*.

Di sayz fɔ di ayt

Krio fɔm kɔntrol dɛn we lɔng ɔ shɔt we de mach di bɔtin saiz dɛn.

<input class="form-control input-lg" type="text" placeholder=".input-lg">
<input class="form-control" type="text" placeholder="Default input">
<input class="form-control input-sm" type="text" placeholder=".input-sm">

<select class="form-control input-lg">...</select>
<select class="form-control">...</select>
<select class="form-control input-sm">...</select>

Ɔrizɔntal fɔm grup saiz dɛn

Kwik kwik wan saiz lɛbl ɛn fɔm kɔntrol dɛn insay .form-horizontalbay we yu ad .form-group-lgɔ .form-group-sm.

<form class="form-horizontal">
  <div class="form-group form-group-lg">
    <label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label>
    <div class="col-sm-10">
      <input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input">
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label>
    <div class="col-sm-10">
      <input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input">
    </div>
  </div>
</form>

Di sayz fɔ di kɔlɔm dɛn

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.

<div class="row">
  <div class="col-xs-2">
    <input type="text" class="form-control" placeholder=".col-xs-2">
  </div>
  <div class="col-xs-3">
    <input type="text" class="form-control" placeholder=".col-xs-3">
  </div>
  <div class="col-xs-4">
    <input type="text" class="form-control" placeholder=".col-xs-4">
  </div>
</div>

Bɔtin dɛn

Di tag dɛn we de na di bɔtin

Yuz di bɔtin klas dɛn na wan <a>, <button>, ɔ <input>ɛlimɛnt.

Link
<a class="btn btn-default" href="#" role="button">Link</a>
<button class="btn btn-default" type="submit">Button</button>
<input class="btn btn-default" type="button" value="Input">
<input class="btn btn-default" type="submit" value="Submit">

Di we aw dɛn de yuz am fɔ di kɔntɛks

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.

Links we de wok lɛk bɔtin 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".

Krɔs-brɔuza rɛnda

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-heightof <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.

Di tin dɛn we yu kin pik fɔ du

Yuz ɛni wan pan di bɔtin klas dɛn we de fɔ mek wan bɔtin we gɛt stayl kwik kwik wan.

<!-- Standard button -->
<button type="button" class="btn btn-default">Default</button>

<!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
<button type="button" class="btn btn-primary">Primary</button>

<!-- Indicates a successful or positive action -->
<button type="button" class="btn btn-success">Success</button>

<!-- Contextual button for informational alert messages -->
<button type="button" class="btn btn-info">Info</button>

<!-- Indicates caution should be taken with this action -->
<button type="button" class="btn btn-warning">Warning</button>

<!-- Indicates a dangerous or potentially negative action -->
<button type="button" class="btn btn-danger">Danger</button>

<!-- Deemphasize a button by making it look like a link while maintaining button behavior -->
<button type="button" class="btn btn-link">Link</button>

Fɔ gi minin to ɛtɛknɔlɔji dɛn we de ɛp

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-onlyklas.

Sayz dɛn

Fans big ɔ smɔl bɔtin dɛn? Ad .btn-lg, .btn-sm, ɔ .btn-xsfɔ ɔda saiz dɛn.

<p>
  <button type="button" class="btn btn-primary btn-lg">Large button</button>
  <button type="button" class="btn btn-default btn-lg">Large button</button>
</p>
<p>
  <button type="button" class="btn btn-primary">Default button</button>
  <button type="button" class="btn btn-default">Default button</button>
</p>
<p>
  <button type="button" class="btn btn-primary btn-sm">Small button</button>
  <button type="button" class="btn btn-default btn-sm">Small button</button>
</p>
<p>
  <button type="button" class="btn btn-primary btn-xs">Extra small button</button>
  <button type="button" class="btn btn-default btn-xs">Extra small button</button>
</p>

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.

<button type="button" class="btn btn-primary btn-lg btn-block">Block level button</button>
<button type="button" class="btn btn-default btn-lg btn-block">Block level button</button>

Aktiv stet we de wok

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 .activepan <button>s (ɛn inklud di aria-pressed="true"atribyut) if yu nid fɔ riplik di aktiv stet programmatik wan.

Elemɛnt fɔ di bɔtin

No nid fɔ ad :activeas na pseudo-klas, bɔt if yu nid fɔ fos di sem apinɛns, go bifo ɛn ad .active.

<button type="button" class="btn btn-primary btn-lg active">Primary button</button>
<button type="button" class="btn btn-default btn-lg active">Button</button>

Ankɔr ɛlimɛnt

Ad di .activeklas to di <a>bɔtin dɛn.

Praymari link fɔ di wan dɛn we de Link

<a href="#" class="btn btn-primary btn-lg active" role="button">Primary link</a>
<a href="#" class="btn btn-default btn-lg active" role="button">Link</a>

Disabled stet

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.

Elemɛnt fɔ di bɔtin

Ad di disabledatribyut to di <button>bɔtin dɛn.

<button type="button" class="btn btn-lg btn-primary" disabled="disabled">Primary button</button>
<button type="button" class="btn btn-default btn-lg" disabled="disabled">Button</button>

Krɔs-brauza kɔmpitibliti

If yu ad di disabledatribyut 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.

Ankɔr ɛlimɛnt

Ad di .disabledklas to di <a>bɔtin dɛn.

Praymari link fɔ di wan dɛn we de Link

<a href="#" class="btn btn-primary btn-lg disabled" role="button">Primary link</a>
<a href="#" class="btn btn-default btn-lg disabled" role="button">Link</a>

Wi de yuz .disabledas yutiliti klas ya, we fiba di kɔmɔn .activeklas, so dɛn nɔ nid fɔ gɛt prɛfiks.

Link funkshɔnaliti caveat

Dis klas de yuz pointer-events: nonefɔ 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

Imej dɛn we de ansa

Imej dɛn na Bootstrap 3 kin mek dɛn ansa-frenli via di adishɔn fɔ di .img-responsiveklas. 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-responsiveklas, yuz .center-blockinstead fɔ .text-center. Si di ɛlda klas dɛn sɛkshɔn fɔ no mɔ bɔt aw fɔ .center-blockyuz am.

SVG imej ɛn IE 8-10

Insay Intanɛt Ɛksplɔrɔ 8-10, SVG pikchɔ dɛn wit .img-responsivena 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.

<img src="..." class="img-responsive" alt="Responsive image">

Imej shep dɛn

Ad klas dɛn to wan <img>ɛlimɛnt fɔ mek i izi fɔ stayl pikchɔ dɛn na ɛni prɔjek.

Krɔs-brauza kɔmpitibliti

Kip in maynd se Intanɛt Ɛksplɔrɔ 8 nɔ gɛt sɔpɔt fɔ rawnd kɔna dɛn.

140x140 na di pikchɔ 140x140 na di pikchɔ 140x140 na di pikchɔ
<img src="..." alt="..." class="img-rounded">
<img src="..." alt="..." class="img-circle">
<img src="..." alt="..." class="img-thumbnail">

Ɛpman klas dɛn

Di kɔlɔ dɛn we de insay di kɔntɛks

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.

<p class="text-muted">...</p>
<p class="text-primary">...</p>
<p class="text-success">...</p>
<p class="text-info">...</p>
<p class="text-warning">...</p>
<p class="text-danger">...</p>

Dil wit spɛsifisiti

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.

Fɔ gi minin to ɛtɛknɔlɔji dɛn we de ɛp

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-onlyklas .

Di bakgrɔn dɛn we de na di kɔntɛks

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.

<p class="bg-primary">...</p>
<p class="bg-success">...</p>
<p class="bg-info">...</p>
<p class="bg-warning">...</p>
<p class="bg-danger">...</p>

Dil wit spɛsifisiti

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.

Fɔ gi minin to ɛtɛknɔlɔji dɛn we de ɛp

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.

Klos di aykɔn

Yuz di jenɛrik klos aykɔn fɔ dismis kɔntinyu lɛk modal ɛn alɛt.

<button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>

Karɛt dɛn

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 .

<span class="caret"></span>

Kwik flot dɛn

Flɔt wan ɛlimɛnt na di lɛft ɔ rayt wit wan klas. !importantna inklud fɔ avɔyd spɛsifisiti kwɛshɔn dɛn. Yu kin yuz klas dɛn bak as miksin.

<div class="pull-left">...</div>
<div class="pull-right">...</div>
// Classes
.pull-left {
  float: left !important;
}
.pull-right {
  float: right !important;
}

// Usage as mixins
.element {
  .pull-left();
}
.another-element {
  .pull-right();
}

Nɔto fɔ yuz na navbar dɛn

Fɔ alaynɛd ​​kɔmpɔnɛnt dɛn na navbar wit yutiliti klas dɛn, yuz .navbar-leftɔ .navbar-rightinsted. Si di navbar docs fɔ di ditel dɛn.

Senta kɔntinyu blɔk dɛn

Set wan elemɛnt to display: blockɛn sɛnt via margin. Available as wan mixin ɛn klas.

<div class="center-block">...</div>
// Class
.center-block {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

// Usage as a mixin
.element {
  .center-block();
}

Kliafiks

I izi fɔ klia floats 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.

<!-- Usage as a class -->
<div class="clearfix">...</div>
// Mixin itself
.clearfix() {
  &:before,
  &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}

// Usage as a mixin
.element {
  .clearfix();
}

Fɔ sho ɛn ayd di tin dɛn we de insay

Fos wan ɛlimɛnt fɔ sho ɔ ayd ( inklud fɔ skrin rida dɛn ) wit di yus fɔ .showɛn .hiddenklas dɛn. Dɛn klas ya kin yuz !importantfɔ 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.

.hidede, 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-onlyinsted.

Dɔn bak, .invisibledɛn kin yuz am fɔ tɔgl ɔl di visibiliti fɔ wan ɛlimɛnt, we min se in displaynɔ chenj ɛn di ɛlimɛnt kin stil afɛkt di flɔ fɔ di dɔkyumɛnt.

<div class="show">...</div>
<div class="hidden">...</div>
// Classes
.show {
  display: block !important;
}
.hidden {
  display: none !important;
}
.invisible {
  visibility: hidden;
}

// Usage as mixins
.element {
  .show();
}
.another-element {
  .hidden();
}

Skrin rida ɛn kibɔd nevigishɔn kɔntinyu

Ayd wan ɛlimɛnt to ɔl divays dɛn pas skrin rida dɛn wit .sr-only. Kɔmbayn .sr-onlywit .sr-only-focusablefɔ 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.

<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
// Usage as a mixin
.skip-navigation {
  .sr-only();
  .sr-only-focusable();
}

Imej riplesmɛnt

Yuz di .text-hideklas ɔ mixin fɔ ɛp fɔ riples wan ɛlimɛnt in tɛks kɔntinyu wit bakgrɔn pikchɔ.

<h1 class="text-hide">Custom heading</h1>
// Usage as a mixin
.heading {
  .text-hide();
}

Yutiliti dɛn we de ansa

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.

Klas dɛn we de

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
.visible-sm-* Wi kin si am
.visible-md-* Wi kin si am
.visible-lg-* Wi kin si am
.hidden-xs Wi kin si am Wi kin si am Wi kin si am
.hidden-sm Wi kin si am Wi kin si am Wi kin si am
.hidden-md Wi kin si am Wi kin si am Wi kin si am
.hidden-lg Wi kin si am Wi kin si am Wi kin si am

As of v3.2.0, di .visible-*-*klas dɛm fɔ ɛni brekpɔynt kam insay tri chenj dɛm, wan fɔ ɛni CSS displayprɔ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-lgdɛ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.

Print klas 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
Wi kin si am
.hidden-print Wi kin si am

Di klas .visible-printde 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.

Test kes dɛn

Risayz yu brɔwza ɔ lod pan difrɛn divays dɛn fɔ tɛst di yutiliti klas dɛn we de ansa.

Yu kin si am na...

Grin chɛkmak dɛn de sho se di ɛlimɛnt de sho na di say we yu de si naw.

✔ Yu kin si am na x-smɔl
✔ Yu kin si am pan smɔl smɔl tin dɛn
Lukin-grɔn uman ✔ Yu kin si am na midul
✔ Yu kin si am pan big wan
✔ Yu kin si am na x-smɔl ɛn smɔl
✔ Yu kin si am pan midul ɛn big
✔ Yu kin si am na x-smɔl ɛn midul
✔ Yu kin si am pan smɔl ɛn big
✔ Yu kin si am na x-smɔl ɛn big
✔ Yu kin si am pan smɔl ɛn midul

Dɛn ayd am na...

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.

✔ Ayd pan x-smɔl
✔ Dɛn ayd am pan smɔl smɔl
Lukin-grɔn uman ✔ Dɛn ayd am pan midul
✔ Dɛn ayd am pan big big wan
✔ Ayd pan x-smɔl ɛn smɔl
✔ Ayd pan midul ɛn big
✔ Ayd pan x-smɔl ɛn midul
✔ Ayd pan smɔl ɛn big
✔ Ayd pan x-smɔl ɛn big
✔ Ayd pan smɔl ɛn midul

Yuz Lɛs

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 .

We dɛn de kɔmpilayt di Bootstrap

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.

Di tin dɛn we kin chenj

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 .

Kɔlɔ dɛn

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.

@gray-darker:  lighten(#000, 13.5%); // #222
@gray-dark:    lighten(#000, 20%);   // #333
@gray:         lighten(#000, 33.5%); // #555
@gray-light:   lighten(#000, 46.7%); // #777
@gray-lighter: lighten(#000, 93.5%); // #eee
@brand-primary: darken(#428bca, 6.5%); // #337ab7
@brand-success: #5cb85c;
@brand-info:    #5bc0de;
@brand-warning: #f0ad4e;
@brand-danger:  #d9534f;

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.

// Use as-is
.masthead {
  background-color: @brand-primary;
}

// Reassigned variables in Less
@alert-message-background: @brand-info;
.alert {
  background-color: @alert-message-background;
}

Skɔf we dɛn kin yuz fɔ mek skɔf

Wan handful of variables fɔ kwik kwik wan kɔstɔmayz ki ɛlimɛnt dɛn na yu sayt in skel.

// Scaffolding
@body-bg:    #fff;
@text-color: @black-50;

I izi fɔ stayl yu link dɛn wit di rayt kɔlɔ wit wan valyu nɔmɔ.

// Variables
@link-color:       @brand-primary;
@link-hover-color: darken(@link-color, 15%);

// Usage
a {
  color: @link-color;
  text-decoration: none;

  &:hover {
    color: @link-hover-color;
    text-decoration: underline;
  }
}

Notis se di @link-hover-coloryuz 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.

Taypografi

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.

@font-family-sans-serif:  "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-serif:       Georgia, "Times New Roman", Times, serif;
@font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace;
@font-family-base:        @font-family-sans-serif;

@font-size-base:          14px;
@font-size-large:         ceil((@font-size-base * 1.25)); // ~18px
@font-size-small:         ceil((@font-size-base * 0.85)); // ~12px

@font-size-h1:            floor((@font-size-base * 2.6)); // ~36px
@font-size-h2:            floor((@font-size-base * 2.15)); // ~30px
@font-size-h3:            ceil((@font-size-base * 1.7)); // ~24px
@font-size-h4:            ceil((@font-size-base * 1.25)); // ~18px
@font-size-h5:            @font-size-base;
@font-size-h6:            ceil((@font-size-base * 0.85)); // ~12px

@line-height-base:        1.428571429; // 20/14
@line-height-computed:    floor((@font-size-base * @line-height-base)); // ~20px

@headings-font-family:    inherit;
@headings-font-weight:    500;
@headings-line-height:    1.1;
@headings-color:          inherit;

Aykɔn dɛn

Tu kwik variebul fɔ kɔstɔmayz di say ɛn fayl nem fɔ yu aykɔn dɛn.

@icon-font-path:          "../fonts/";
@icon-font-name:          "glyphicons-halflings-regular";

Di tin dɛn we de insay di bɔdi

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ɔ.

@padding-base-vertical:          6px;
@padding-base-horizontal:        12px;

@padding-large-vertical:         10px;
@padding-large-horizontal:       16px;

@padding-small-vertical:         5px;
@padding-small-horizontal:       10px;

@padding-xs-vertical:            1px;
@padding-xs-horizontal:          5px;

@line-height-large:              1.33;
@line-height-small:              1.5;

@border-radius-base:             4px;
@border-radius-large:            6px;
@border-radius-small:            3px;

@component-active-color:         #fff;
@component-active-bg:            @brand-primary;

@caret-width-base:               4px;
@caret-width-large:              5px;

Vendor miksin dɛn

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.

Bɔks-sayz

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.

.box-sizing(@box-model) {
  -webkit-box-sizing: @box-model; // Safari <= 5
     -moz-box-sizing: @box-model; // Firefox <= 19
          box-sizing: @box-model;
}

Kɔna dɛn we dɛn dɔn rawnd

Tide ɔl di mɔdan brawza dɛn de sɔpɔt di border-radiusprɔ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.

.border-top-radius(@radius) {
  border-top-right-radius: @radius;
   border-top-left-radius: @radius;
}
.border-right-radius(@radius) {
  border-bottom-right-radius: @radius;
     border-top-right-radius: @radius;
}
.border-bottom-radius(@radius) {
  border-bottom-right-radius: @radius;
   border-bottom-left-radius: @radius;
}
.border-left-radius(@radius) {
  border-bottom-left-radius: @radius;
     border-top-left-radius: @radius;
}

Bɔks (Drop) shado dɛn

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-shadowprɔ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.

.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
          box-shadow: @shadow;
}

Di tin dɛn we de chenj

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.

.transition(@transition) {
  -webkit-transition: @transition;
          transition: @transition;
}
.transition-property(@transition-property) {
  -webkit-transition-property: @transition-property;
          transition-property: @transition-property;
}
.transition-delay(@transition-delay) {
  -webkit-transition-delay: @transition-delay;
          transition-delay: @transition-delay;
}
.transition-duration(@transition-duration) {
  -webkit-transition-duration: @transition-duration;
          transition-duration: @transition-duration;
}
.transition-timing-function(@timing-function) {
  -webkit-transition-timing-function: @timing-function;
          transition-timing-function: @timing-function;
}
.transition-transform(@transition) {
  -webkit-transition: -webkit-transform @transition;
     -moz-transition: -moz-transform @transition;
       -o-transition: -o-transform @transition;
          transition: transform @transition;
}

Di chenj dɛn we de apin

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.

.rotate(@degrees) {
  -webkit-transform: rotate(@degrees);
      -ms-transform: rotate(@degrees); // IE9 only
          transform: rotate(@degrees);
}
.scale(@ratio; @ratio-y...) {
  -webkit-transform: scale(@ratio, @ratio-y);
      -ms-transform: scale(@ratio, @ratio-y); // IE9 only
          transform: scale(@ratio, @ratio-y);
}
.translate(@x; @y) {
  -webkit-transform: translate(@x, @y);
      -ms-transform: translate(@x, @y); // IE9 only
          transform: translate(@x, @y);
}
.skew(@x; @y) {
  -webkit-transform: skew(@x, @y);
      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
          transform: skew(@x, @y);
}
.translate3d(@x; @y; @z) {
  -webkit-transform: translate3d(@x, @y, @z);
          transform: translate3d(@x, @y, @z);
}

.rotateX(@degrees) {
  -webkit-transform: rotateX(@degrees);
      -ms-transform: rotateX(@degrees); // IE9 only
          transform: rotateX(@degrees);
}
.rotateY(@degrees) {
  -webkit-transform: rotateY(@degrees);
      -ms-transform: rotateY(@degrees); // IE9 only
          transform: rotateY(@degrees);
}
.perspective(@perspective) {
  -webkit-perspective: @perspective;
     -moz-perspective: @perspective;
          perspective: @perspective;
}
.perspective-origin(@perspective) {
  -webkit-perspective-origin: @perspective;
     -moz-perspective-origin: @perspective;
          perspective-origin: @perspective;
}
.transform-origin(@origin) {
  -webkit-transform-origin: @origin;
     -moz-transform-origin: @origin;
      -ms-transform-origin: @origin; // IE9 only
          transform-origin: @origin;
}

Animɛshɔn dɛn

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.

.animation(@animation) {
  -webkit-animation: @animation;
          animation: @animation;
}
.animation-name(@name) {
  -webkit-animation-name: @name;
          animation-name: @name;
}
.animation-duration(@duration) {
  -webkit-animation-duration: @duration;
          animation-duration: @duration;
}
.animation-timing-function(@timing-function) {
  -webkit-animation-timing-function: @timing-function;
          animation-timing-function: @timing-function;
}
.animation-delay(@delay) {
  -webkit-animation-delay: @delay;
          animation-delay: @delay;
}
.animation-iteration-count(@iteration-count) {
  -webkit-animation-iteration-count: @iteration-count;
          animation-iteration-count: @iteration-count;
}
.animation-direction(@direction) {
  -webkit-animation-direction: @direction;
          animation-direction: @direction;
}

Opasiti fɔ di tin dɛn we de apin

Set di opasiti fɔ ɔl di brawza dɛn ɛn gi wan filterfɔl bak fɔ IE8.

.opacity(@opacity) {
  opacity: @opacity;
  // IE8 filter
  @opacity-ie: (@opacity * 100);
  filter: ~"alpha(opacity=@{opacity-ie})";
}

Pleshɔlda tɛks

Gi kɔntɛks fɔ fɔm kɔntrol dɛn insay ɛni fil.

.placeholder(@color: @input-color-placeholder) {
  &::-moz-placeholder           { color: @color; } // Firefox
  &:-ms-input-placeholder       { color: @color; } // Internet Explorer 10+
  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome
}

Kɔlɔm dɛn

Jɛnɛret kɔlɔm dɛn via CSS insay wan singl ɛlimɛnt.

.content-columns(@width; @count; @gap) {
  -webkit-column-width: @width;
     -moz-column-width: @width;
          column-width: @width;
  -webkit-column-count: @count;
     -moz-column-count: @count;
          column-count: @count;
  -webkit-column-gap: @gap;
     -moz-column-gap: @gap;
          column-gap: @gap;
}

Grɛdiɛnt dɛn

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.

#gradient > .vertical(#333; #000);
#gradient > .horizontal(#333; #000);
#gradient > .radial(#333; #000);

Yu kin spɛsifa bak di angul fɔ wan standad tu-kɔlɔ, linya grɛdiɛnt:

#gradient > .directional(#333; #000; 45deg);

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.

#gradient > .striped(#333; 45deg);

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:

#gradient > .vertical-three-colors(#777; #333; 25%; #000);
#gradient > .horizontal-three-colors(#777; #333; 25%; #000);

Hed dɛn de ɔp! If yu ɛva nid fɔ pul wan gradient, mek shɔ se yu pul ɛni IE-spɛsifi k we filteryu go dɔn ad. Yu kin du dat bay we yu yuz di .reset-filter()mixin nia background-image: none;.

Yutiliti miksin dɛn

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.

Kliafiks

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 .

// Mixin
.clearfix() {
  &:before,
  &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}

// Usage
.container {
  .clearfix();
}

Ɔrizɔntal sɛntrin

Kwik wan sɛnt ɛni ɛlimɛnt insay in mama ɔ papa. Rikways widthɔ max-widthfɔ sɛt am.

// Mixin
.center-block() {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

// Usage
.container {
  width: 940px;
  .center-block();
}

Di wan dɛn we de ɛp pipul dɛn fɔ saiz

Spɛsifikɛt di dimɛnshɔn dɛn fɔ wan tin izi wan.

// Mixins
.size(@width; @height) {
  width: @width;
  height: @height;
}
.square(@size) {
  .size(@size; @size);
}

// Usage
.image { .size(400px; 300px); }
.avatar { .square(48px); }

Teks eria dɛn we dɛn kin chenj di sayz

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).

.resizable(@direction: both) {
  // Options: horizontal, vertical, both
  resize: @direction;
  // Safari fix
  overflow: auto;
}

Fɔ kɔt di tɛks

I izi fɔ trunkat tɛks wit wan ɛlipsis wit wan singl miksin. Rikways element fɔ bi blockɔ inline-blocklɛvɛl.

// Mixin
.text-overflow() {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// Usage
.branch-name {
  display: inline-block;
  max-width: 200px;
  .text-overflow();
}

Retina imej dɛn

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.

.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
  background-image: url("@{file-1x}");

  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and (     -o-min-device-pixel-ratio: 2/1),
  only screen and (        min-device-pixel-ratio: 2),
  only screen and (                min-resolution: 192dpi),
  only screen and (                min-resolution: 2dppx) {
    background-image: url("@{file-2x}");
    background-size: @width-1x @height-1x;
  }
}

// Usage
.jumbotron {
  .img-retina("/img/bg-1x.png", "/img/bg-2x.png", 100px, 100px);
}

We yu de yuz Sass

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.

Wetin de insay

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.

Instɔlɛshɔn

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.

Bootstrap fɔ Sass