Source

Eget ratio

Utere flexo flexo mobili potenti nostro ad rationes omnium formarum et magnitudinum faciendarum per rationes duodecim columnarum, quinque gradibus respondentium default, variabilium Sass et mixinorum, ac justos classium praedefinitorum.

Quomodo facitur

Bootstrap ratio eget systematis utitur serie continentium, versuum et columnarum ad layout et align contentorum. Cum flexbox constructum est et plene responsivum est. Infra exemplum est et altissimam vide quomodo euismod coit.

Novi vel flexbox insuetis? Lege hunc CSS Tricks flexboxs guide for background, terminologia, guidelines and code excerpta.

Una trium columnarum
Una trium columnarum
Una trium columnarum
<div class="container">
  <div class="row">
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
  </div>
</div>

Exemplum superius tres columnas aequales latas in parvis, mediis, magnis, et extra grandes machinas utentes classibus eget praedefinitis nostris creat. Columnae istae in pagina cum parente centae sunt .container.

Solvendo, hic quomodo agit;

  • Vasa media praebent ad centrum ac transversatim codex tui situs contenta. Utere .containerad pixelam responsivam latitudinem vel .container-fluidper width: 100%omnes magnitudinum prospectus et machinae.
  • Ordines columnarum involucri sunt. Quaelibet columna horizontalem padding(quae stillicidium vocant) ad spatium inter se moderandum habet. Hoc paddingest ergo in versibus negativis marginibus counteracted. Hoc modo omnia contenta in columnis tuis sinistrum latus uisum est aligned.
  • In eget arcu, contenti intra columnas collocari debent et tantum columnae immediatae esse possunt puerorum ordinum.
  • Gratias flexbox, columnas eget sine certa widthvoluntate sponte pones sicut columnas latitudines aequales. Exempli gratia: quattuor instantiae .col-smvoluntatis singulae sponte 25% latae erunt a parvo puncto et sursum. Vide sectionem columnarum auto- ponendam pluribus exemplis.
  • Columnae classes numerum columnarum indicantes ex 12 per versu possibili uti velis. Si ergo tres columnas aequales latas vis transversas , uti potes .col-4.
  • Columnae widths in percentages collocatae sunt, ergo semper fluidi sunt et ad elementum parentis sui mediocri.
  • Columnae horizontales inter singulas columnas canales creare possunt, tamen a ordinibus et a columnis cum super paddingamoveri potes .marginpadding.no-gutters.row
  • Ad craticulam responsurum, quinque fracturae craticulae sunt, una pro unaquaque fractura responsiva : omnes fracturae (extra minima), parva, media, magna et extra magnum.
  • Grid puncta puncta in mediis quaestionibus minimae latitudinis fundantur, significantes unum punctum et omnes superiores (eg, .col-sm-4parvis, mediis, magnis, et extra grandes machinas, non autem primum xspunctum) applicant.
  • Potes uti praedefinitis eget classibus (similis .col-4) vel mixins Sass pro charactere plus semantico.

Animadverte limitationes et cimices circa flexboxs , sicut non posse uti aliqua HTML elementa sicut vascula flexiva .

Eget optiones

Dum Bootstrap utitur ems vel rems ad definiendas amplissimas magnitudinum, pxs adhibentur ad fracturae puncta et latitudines continens. Hoc est quod latitudo prospecti elementa inest et cum magnitudine fontis non mutat .

Vide quomodo aspectus Bootstrap eget systematis per multiplices machinis cum manu manus habilis laborant.

Extra parva
<576px
Parvus
≥576px
Medium
≥768px
Magnae
≥992px
Extra magnum
≥1200px
Max continens latitudo Nemo (auto) 540px 720px 960px 1140px
Classis praepositionis .col- .col-sm- .col-md- .col-lg- .col-xl-
# Columnarum 12
Tetigisset domatum fistulas latitudo 30px (15px in utraque parte columnae)
Nestable Ita
Columna ordinatio Ita

Auto-layout columnas

Utere ad breakpoint-specificae columnae classes ad faciliorem columnam inspectionem sine classe explicata numero similia .col-sm-6.

aequalis latitudo

Exempli gratia, hic duo proposita eget arcu quae ad omnem fabricam et conspectum pertinent, ab xsad xl. Adde quotlibet unitates-minores classes pro singulis ruptionibus quibus indigetis et cuiuslibet columnae latitudo eadem erit.

1 of 2
2 of 2
1 of 3
2 of 3
3 of 3
<div class="container">
  <div class="row">
    <div class="col">
      1 of 2
    </div>
    <div class="col">
      2 of 2
    </div>
  </div>
  <div class="row">
    <div class="col">
      1 of 3
    </div>
    <div class="col">
      2 of 3
    </div>
    <div class="col">
      3 of 3
    </div>
  </div>
</div>

Columnae aequalis-latitudines in plures lineas frangi possunt, sed flexo safari cimex erat , qui hoc impediret quin operaretur sine explicatione flex-basisvel border. Versiones navigandi antiquiores operas sunt, sed necessariae non sunt si nunc hodie es.

Columna
Columna
Columna
Columna
<div class="container">
  <div class="row">
    <div class="col">Column</div>
    <div class="col">Column</div>
    <div class="w-100"></div>
    <div class="col">Column</div>
    <div class="col">Column</div>
  </div>
</div>

Profecta columna una latitudo

Auto-layout pro flexbox columnis eget etiam significat latitudinem unius columnae constituere potes et circa eam sponte resize columnas germanas habere. Potes uti eget classibus praedefinitis (ut infra ostendetur), eget mixins, vel inversae lineae. Nota quod alie columnae resizent nullam rem latitudinem centri columnae.

1 of 3
2 cf.
3 of 3
1 of 3
2 cf.
3 of 3
<div class="container">
  <div class="row">
    <div class="col">
      1 of 3
    </div>
    <div class="col-6">
      2 of 3 (wider)
    </div>
    <div class="col">
      3 of 3
    </div>
  </div>
  <div class="row">
    <div class="col">
      1 of 3
    </div>
    <div class="col-5">
      2 of 3 (wider)
    </div>
    <div class="col">
      3 of 3
    </div>
  </div>
</div>

Variabilis latitudo content

Classes uti col-{breakpoint}-autoad magnitudinem columnarum secundum naturalem latitudinem contenti sunt.

1 of 3
Variabilis latitudo content
3 of 3
1 of 3
Variabilis latitudo content
3 of 3
<div class="container">
  <div class="row justify-content-md-center">
    <div class="col col-lg-2">
      1 of 3
    </div>
    <div class="col-md-auto">
      Variable width content
    </div>
    <div class="col col-lg-2">
      3 of 3
    </div>
  </div>
  <div class="row">
    <div class="col">
      1 of 3
    </div>
    <div class="col-md-auto">
      Variable width content
    </div>
    <div class="col col-lg-2">
      3 of 3
    </div>
  </div>
</div>

Latitudo aequalis multi-row

Aequales columnas latas crea, quae multiplices ordines claudunt, inserendo .w-100ubi columnas vis ad novam lineam rumpere. Fac rumpit responsivam miscendo .w-100cum utilitates aliquas responsivas ostentationis .

col
col
col
col
<div class="row">
  <div class="col">col</div>
  <div class="col">col</div>
  <div class="w-100"></div>
  <div class="col">col</div>
  <div class="col">col</div>
</div>

Responsivum classes

Eget eget Bootstrap quinque ordines praedefinitorum classes ad aedificandas rationes multiplices responsivas. Magnitudinem columnarum tuorum extra parvas, parvas, medias, magnas, vel extra magnas machinas quamlibet aptas exerce.

Omnes breakpoints

Nam grides ipsae a minimis ad maximas cogitationes, uti .colet .col-*classes. Specificare genus numeratum cum columna singulari opus est; aliter, libenter adhaerere .col.

col
col
col
col
col-8
col-4
<div class="row">
  <div class="col">col</div>
  <div class="col">col</div>
  <div class="col">col</div>
  <div class="col">col</div>
</div>
<div class="row">
  <div class="col-8">col-8</div>
  <div class="col-4">col-4</div>
</div>

Reclinant ad horizontem

Uno ordine .col-sm-*classium utens, rationem postulationis fundamentalem facere potes quae reclinata incipit antequam horizontalis fiat cum parvo breakpoint ( sm).

col-sm-8
col-sm-4
col-sm
col-sm
col-sm
<div class="row">
  <div class="col-sm-8">col-sm-8</div>
  <div class="col-sm-4">col-sm-4</div>
</div>
<div class="row">
  <div class="col-sm">col-sm</div>
  <div class="col-sm">col-sm</div>
  <div class="col-sm">col-sm</div>
</div>

Misce et aequare

Non vis tuas columnas ad solum ACERVUS in quibusdam gradibus euismod? Utere compositione diversorum generum pro unoquoque ordine prout opus est. Vide infra exemplum melioris notionis quomodo omnia operatur.

.col-12 .col-md-8
.col-6 .col-md-4
.col-6 .col-md-4
.col-6 .col-md-4
.col-6 .col-md-4
.col-6
.col-6
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
  <div class="col-12 col-md-8">.col-12 .col-md-8</div>
  <div class="col-6 col-md-4">.col-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-6 col-md-4">.col-6 .col-md-4</div>
  <div class="col-6 col-md-4">.col-6 .col-md-4</div>
  <div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>

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

Gratia diei et noctis

Utere flexbox alignment utilitates ad perpendiculum et horizontaliter align columnas.

Gratia diei et noctis verticalis

Una trium columnarum
Una trium columnarum
Una trium columnarum
Una trium columnarum
Una trium columnarum
Una trium columnarum
Una trium columnarum
Una trium columnarum
Una trium columnarum
<div class="container">
  <div class="row align-items-start">
    <div class="col">
      One of three columns
    </div>
    <div class="col">
      One of three columns
    </div>
    <div class="col">
      One of three columns
    </div>
  </div>
  <div class="row align-items-center">
    <div class="col">
      One of three columns
    </div>
    <div class="col">
      One of three columns
    </div>
    <div class="col">
      One of three columns
    </div>
  </div>
  <div class="row align-items-end">
    <div class="col">
      One of three columns
    </div>
    <div class="col">
      One of three columns
    </div>
    <div class="col">
      One of three columns
    </div>
  </div>
</div>
Una trium columnarum
Una trium columnarum
Una trium columnarum
<div class="container">
  <div class="row">
    <div class="col align-self-start">
      One of three columns
    </div>
    <div class="col align-self-center">
      One of three columns
    </div>
    <div class="col align-self-end">
      One of three columns
    </div>
  </div>
</div>

Noctis Horizontalis

Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
Una duarum columnarum
<div class="container">
  <div class="row justify-content-start">
    <div class="col-4">
      One of two columns
    </div>
    <div class="col-4">
      One of two columns
    </div>
  </div>
  <div class="row justify-content-center">
    <div class="col-4">
      One of two columns
    </div>
    <div class="col-4">
      One of two columns
    </div>
  </div>
  <div class="row justify-content-end">
    <div class="col-4">
      One of two columns
    </div>
    <div class="col-4">
      One of two columns
    </div>
  </div>
  <div class="row justify-content-around">
    <div class="col-4">
      One of two columns
    </div>
    <div class="col-4">
      One of two columns
    </div>
  </div>
  <div class="row justify-content-between">
    <div class="col-4">
      One of two columns
    </div>
    <div class="col-4">
      One of two columns
    </div>
  </div>
</div>

Non tetigisset domatum fistulas

Canales inter columnas in eget classibus praedefinitis nostris tolli possunt .no-gutters. Hoc removet nega- margins e .rowet horizontalem paddingab omnibus immediatis infantum columnis.

Hic fons est codicem ad hos stylos creandos. Nota quod columnae overrides sunt scoped ad solum primos columnas infantium et sunt iaculis per attributum selectorem . Dum haec selector subtilius generat, columna nulla adhuc adhuc in usu spatiis utilitatibus nativus esse potest .

Egesne ora ut- crepidine consilio? .containerAut parens stilla .container-fluid.

.no-gutters {
  margin-right: 0;
  margin-left: 0;

  > .col,
  > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
  }
}

Re, hic quam spectat. Nota potes hoc uti cum omnibus aliis classibus praefinitis eget (including columnas latitudines, ordines, reordinationes et plura).

.col-12 .col-sm-6 .col-md-8
.col-6 .col-md-4
<div class="row no-gutters">
  <div class="col-12 col-sm-6 col-md-8">.col-12 .col-sm-6 .col-md-8</div>
  <div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>

involutio columna

Si plures quam 12 columnae intra unum ordinem collocantur, singulae extra columnarum globi, ut una unitas, novam lineam involvent.

.col-9
.col-4
Cum 9 + 4 = 13 > 12, haec 4-columna-lata div involvit in novam lineam unam contiguam unitatem.
.col-6 Sequentes
columnae pergunt in linea nova.
<div class="row">
  <div class="col-9">.col-9</div>
  <div class="col-4">.col-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-6">.col-6<br>Subsequent columns continue along the new line.</div>
</div>

Columna erumpit

Columnas fractis ad lineam novam in flexbox parvam hack requirit: elementum adde cum width: 100%quocunque columnas tuas ad novam lineam involvere vis. Communiter hoc fit cum multiplex .rows, sed non omnis modus exsecutionis huius rationem reddere potest.

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

  <!-- Force next columns to break to new line -->
  <div class="w-100"></div>

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

Hanc confractionem ad certas confractiones applicare etiam potest cum utilitates nostras responsivas ostentationis .

.col-6 .col-sm-4
.col-6 .col-sm-4
.col-6 .col-sm-4
.col-6 .col-sm-4
<div class="row">
  <div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
  <div class="col-6 col-sm-4">.col-6 .col-sm-4</div>

  <!-- Force next columns to break to new line at md breakpoint and up -->
  <div class="w-100 d-none d-md-block"></div>

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

Reordering

Ordo classes

Utere .order-classes ad moderandum ordinem contentus visualium tuorum. Classes haec responsabilia sunt, ut orderper confractionem (eg, .order-1.order-md-2). Includes support for 1per 12omnes quinque lineas euismod.

Primum, sed inordinatum
Secundo, sed ultimo
Tertia, sed prima
<div class="container">
  <div class="row">
    <div class="col">
      First, but unordered
    </div>
    <div class="col order-12">
      Second, but last
    </div>
    <div class="col order-1">
      Third, but first
    </div>
  </div>
</div>

Sunt etiam responsivae .order-firstet .order-lastclasses, applicando et respective ordermutando elementi ( ) . Hae classes etiam immisceri possunt cum classibus numeratis prout opus est.order: -1order: 13order: $columns + 1.order-*

Primum, sed ultimum
Secundo, sed inordinatum
Tertia, sed prima
<div class="container">
  <div class="row">
    <div class="col order-last">
      First, but last
    </div>
    <div class="col">
      Second, but unordered
    </div>
    <div class="col order-first">
      Third, but first
    </div>
  </div>
</div>

Offsetting columnas

Vos can offsets eget columnas in duobus modis: nostri responsive .offset-grid classes et utilitates nostrae marginis . Eget classes magnitudines ad columnas aequant, margines magis utiles sunt ad propositum velox ubi latitudo cinguli variabilis est.

Offset classes

Movere columnas ad dextram utendi .offset-md-*classes. Haec genera columnae marginem sinistrum augent *. Nam .offset-md-4movet .col-md-4quattuor columnas.

.col-md-4
.col-md-4 .offset-md-4
.col-md-3 .offset-md-3
.col-md-3 .offset-md-3
.col-md-6 .offset-md-3
<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4 offset-md-4">.col-md-4 .offset-md-4</div>
</div>
<div class="row">
  <div class="col-md-3 offset-md-3">.col-md-3 .offset-md-3</div>
  <div class="col-md-3 offset-md-3">.col-md-3 .offset-md-3</div>
</div>
<div class="row">
  <div class="col-md-6 offset-md-3">.col-md-6 .offset-md-3</div>
</div>

Praeter columnas aperiendas ad fracturas responsivas, necesse est ut exsertiones retexere. Vide hoc in agendo in malesuada euismod exemplo .

.col-sm-5 .col-md-6
col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0
col-sm-6 .col-md-5 .col-lg-6
col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0
<div class="row">
  <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
  <div class="col-sm-5 offset-sm-2 col-md-6 offset-md-0">.col-sm-5 .offset-sm-2 .col-md-6 .offset-md-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 offset-md-2 col-lg-6 offset-lg-0">.col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0</div>
</div>

Margin utilitates

Motu ad flexbox in v4, marginibus utilitatibus uti potes ut columnas fraternas ab invicem cogant .mr-auto.

.col-md-4
.col-md-4 .ml-auto
.col-md-3 .ml-md-auto
.col-md-3 .ml-md-auto
.col-auto .mr-auto
.col-auto
<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
</div>
<div class="row">
  <div class="col-md-3 ml-md-auto">.col-md-3 .ml-md-auto</div>
  <div class="col-md-3 ml-md-auto">.col-md-3 .ml-md-auto</div>
</div>
<div class="row">
  <div class="col-auto mr-auto">.col-auto .mr-auto</div>
  <div class="col-auto">.col-auto</div>
</div>

Nidificans

Ut contentus egeo defalta edificare te, novas .rowac columnas intra columnam .col-sm-*existentem appone. .col-sm-*Ordines nestedi includere columnarum copia quae usque ad 12 vel pauciores adde (non requiritur ut omnibus 12 columnis in promptu uteris).

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

Sass mixins

Cum per Bootstrap fontem Sass lima, optionem habes utendi Sass variabilium et mixins ut consuetudo, semantica, et responsiva paginae layout. Classes nostrae praedefinitae eget in eisdem differentiis et mixinis utantur ut integram classem paratarum ad usum generum praebeant ad propositum responsurum celeriter.

Variabilium

Variabiles et mappae numerum columnarum, triviis latitudinem determinant, et punctum instrumentorum quaesitum, quo in columnas volitare incipiant. His utimur ad generandum praedefinitas eget classes supra confirmatas, necnon pro consuetudine mixins infra recensita.

$grid-columns:      12;
$grid-gutter-width: 30px;

$grid-breakpoints: (
  // Extra small screen / phone
  xs: 0,
  // Small screen / phone
  sm: 576px,
  // Medium screen / tablet
  md: 768px,
  // Large screen / desktop
  lg: 992px,
  // Extra large screen / wide desktop
  xl: 1200px
);

$container-max-widths: (
  sm: 540px,
  md: 720px,
  lg: 960px,
  xl: 1140px
);

Mixins

Mixins in conjunctione cum variabilium eget ad generandum semanticam CSS pro singulis columnis eget.

// Creates a wrapper for a series of columns
@include make-row();

// Make the element grid-ready (applying everything but the width)
@include make-col-ready();
@include make-col($size, $columns: $grid-columns);

// Get fancy by offsetting, or changing the sort order
@include make-col-offset($size, $columns: $grid-columns);

Exemplum usus

Mutationes variabiles ad valorum suorum consuetudinum mutare potes, vel mixinis cum eorum defectu valoribus tantum utere. Exemplum est hic usus occasus defectus ad efficiendum duas columnas extensiones cum interstitio.

.example-container {
  width: 800px;
  @include make-container();
}

.example-row {
  @include make-row();
}

.example-content-main {
  @include make-col-ready();

  @include media-breakpoint-up(sm) {
    @include make-col(6);
  }
  @include media-breakpoint-up(lg) {
    @include make-col(8);
  }
}

.example-content-secondary {
  @include make-col-ready();

  @include media-breakpoint-up(sm) {
    @include make-col(6);
  }
  @include media-breakpoint-up(lg) {
    @include make-col(4);
  }
}
Summa content
Secundarium content
<div class="example-container">
  <div class="example-row">
    <div class="example-content-main">Main content</div>
    <div class="example-content-secondary">Secondary content</div>
  </div>
</div>

Customising malesuada euismod

Utendo nostro constructo in eget Sass variabilium et in mappis, potest omnino mos praefinitas classes eget. Mutare numerum linearum, instrumentorum dimensionum interrogationum, et latitudines continens continens, deinde recompile.

Columnae et tetigisset domatum fistulas

Numerus columnarum malesuada euismod mutari potest per variabiles Sass. $grid-columnsadhibetur singulae columnae singulae columnae latitudines generare, dum latitudines $grid-gutter-widthspeciales frangunt, quae aequaliter transversae dividuntur padding-leftet padding-rightpro earum columnae sunt.

$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;

Eget versus

Ultra ipsas columnas movens, etiam numerum ordinum euismod mos esto. Si quattuor tantum ordines egetis esses, renovare velis $grid-breakpointset $container-max-widthsad aliquid simile:

$grid-breakpoints: (
  xs: 0,
  sm: 480px,
  md: 768px,
  lg: 1024px
);

$container-max-widths: (
  sm: 420px,
  md: 720px,
  lg: 960px
);

Cum aliquas mutationes in Sass variabilium aut tabularum faciens, debes mutationes tuas servare et rescribere. Faciens sic outputabit novam notam praedefinitorum classium classium ad columnas inversas, exsertiones, ordinandas. Utilitas responsiva visibilis etiam renovabitur ad usuario fracturae usu. Fac ut valores malesuada euismod in px(non rem, emvel %).