diff --git a/site/content/docs/5.2/examples/grid/index.html b/site/content/docs/5.2/examples/grid/index.html index fae182a1cd7b..7c4f1d322fe9 100644 --- a/site/content/docs/5.2/examples/grid/index.html +++ b/site/content/docs/5.2/examples/grid/index.html @@ -17,37 +17,37 @@

Bootstrap grid examples

Five grid tiers

There are five tiers to the Bootstrap grid system, one for each range of devices we support. Each tier starts at a minimum viewport size and automatically applies to the larger devices unless overridden.

-
+
.col-4
.col-4
.col-4
-
+
.col-sm-4
.col-sm-4
.col-sm-4
-
+
.col-md-4
.col-md-4
.col-md-4
-
+
.col-lg-4
.col-lg-4
.col-lg-4
-
+
.col-xl-4
.col-xl-4
.col-xl-4
-
+
.col-xxl-4
.col-xxl-4
.col-xxl-4
@@ -55,7 +55,7 @@

Five grid tiers

Three equal columns

Get three equal-width columns starting at desktops and scaling to large desktops. On mobile devices, tablets and below, the columns will automatically stack.

-
+
.col-md-4
.col-md-4
.col-md-4
@@ -63,7 +63,7 @@

Three equal columns

Three equal columns alternative

By using the .row-cols-* classes, you can easily create a grid with equal columns.

-
+
.col child of .row-cols-md-3
.col child of .row-cols-md-3
.col child of .row-cols-md-3
@@ -71,7 +71,7 @@

Three equal columns alternative

Three unequal columns

Get three columns starting at desktops and scaling to large desktops of various widths. Remember, grid columns should add up to twelve for a single horizontal block. More than that, and columns start stacking no matter the viewport.

-
+
.col-md-3
.col-md-6
.col-md-3
@@ -79,7 +79,7 @@

Three unequal columns

Two columns

Get two columns starting at desktops and scaling to large desktops.

-
+
.col-md-8
.col-md-4
@@ -94,7 +94,7 @@

Full width, single column

Two columns with two nested columns

Per the documentation, nesting is easy—just put a row of columns within an existing column. This gives you two columns starting at desktops and scaling to large desktops, with another two (equal widths) within the larger column.

At mobile device sizes, tablets and down, these columns and their nested columns will stack.

-
+
.col-md-8 @@ -112,16 +112,16 @@

Two columns with two nested columns

Mixed: mobile and desktop

The Bootstrap v5 grid system has six tiers of classes: xs (extra small, this class infix is not used), sm (small), md (medium), lg (large), xl (x-large), and xxl (xx-large). You can use nearly any combination of these classes to create more dynamic and flexible layouts.

Each tier of classes scales up, meaning if you plan on setting the same widths for md, lg, xl and xxl, you only need to specify md.

-
+
.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
@@ -129,11 +129,11 @@

Mixed: mobile and desktop


Mixed: mobile, tablet, and desktop

-
+
.col-sm-6 .col-lg-8
.col-6 .col-lg-4
-
+
.col-6 .col-sm-4
.col-6 .col-sm-4
.col-6 .col-sm-4
@@ -143,7 +143,7 @@

Mixed: mobile, tablet, and desktop

Gutters

With .gx-* classes, the horizontal gutters can be adjusted.

-
+
.col with .gx-4 gutters
.col with .gx-4 gutters
.col with .gx-4 gutters
@@ -152,7 +152,7 @@

Gutters

.col with .gx-4 gutters

Use the .gy-* classes to control the vertical gutters.

-
+
.col with .gy-4 gutters
.col with .gy-4 gutters
.col with .gy-4 gutters
@@ -161,7 +161,7 @@

Gutters

.col with .gy-4 gutters

With .g-* classes, the gutters in both directions can be adjusted.

-
+
.col with .g-3 gutters
.col with .g-3 gutters
.col with .g-3 gutters
@@ -178,11 +178,11 @@

Containers

Additional classes added in Bootstrap v4.4 allow containers that are 100% wide until a particular breakpoint. v5 adds a new xxl breakpoint.

-
.container
-
.container-sm
-
.container-md
-
.container-lg
-
.container-xl
-
.container-xxl
-
.container-fluid
+
.container
+
.container-sm
+
.container-md
+
.container-lg
+
.container-xl
+
.container-xxl
+
.container-fluid
diff --git a/site/content/docs/5.2/layout/columns.md b/site/content/docs/5.2/layout/columns.md index 5c859065a413..2ebf96ea2513 100644 --- a/site/content/docs/5.2/layout/columns.md +++ b/site/content/docs/5.2/layout/columns.md @@ -25,7 +25,7 @@ Use flexbox alignment utilities to vertically and horizontally align columns. ### Vertical alignment {{< example class="bd-example-row bd-example-row-flex-cols" >}} -
+
One of three columns @@ -63,7 +63,7 @@ Use flexbox alignment utilities to vertically and horizontally align columns. {{< /example >}} {{< example class="bd-example-row bd-example-row-flex-cols" >}} -
+
One of three columns @@ -81,7 +81,7 @@ Use flexbox alignment utilities to vertically and horizontally align columns. ### Horizontal alignment {{< example class="bd-example-row" >}} -
+
One of two columns @@ -152,7 +152,7 @@ If more than 12 columns are placed within a single row, each group of extra colu Breaking columns to a new line in flexbox requires a small hack: add an element with `width: 100%` wherever you want to wrap your columns to a new line. Normally this is accomplished with multiple `.row`s, but not every implementation method can account for this. {{< example class="bd-example-row" >}} -
+
.col-6 .col-sm-3
.col-6 .col-sm-3
@@ -169,7 +169,7 @@ Breaking columns to a new line in flexbox requires a small hack: add an element You may also apply this break at specific breakpoints with our [responsive display utilities]({{< docsref "/utilities/display" >}}). {{< example class="bd-example-row" >}} -
+
.col-6 .col-sm-4
.col-6 .col-sm-4
@@ -190,7 +190,7 @@ You may also apply this break at specific breakpoints with our [responsive displ Use `.order-` classes for controlling the **visual order** of your content. These classes are responsive, so you can set the `order` by breakpoint (e.g., `.order-1.order-md-2`). Includes support for `1` through `5` across all six grid tiers. {{< example class="bd-example-row" >}} -
+
First in DOM, no order applied @@ -208,7 +208,7 @@ Use `.order-` classes for controlling the **visual order** of your content. Thes There are also responsive `.order-first` and `.order-last` classes that change the `order` of an element by applying `order: -1` and `order: 6`, respectively. These classes can also be intermixed with the numbered `.order-*` classes as needed. {{< example class="bd-example-row" >}} -
+
First in DOM, ordered last @@ -232,7 +232,7 @@ You can offset grid columns in two ways: our responsive `.offset-` grid classes Move columns to the right using `.offset-md-*` classes. These classes increase the left margin of a column by `*` columns. For example, `.offset-md-4` moves `.col-md-4` over four columns. {{< example class="bd-example-row" >}} -
+
.col-md-4
.col-md-4 .offset-md-4
@@ -250,7 +250,7 @@ Move columns to the right using `.offset-md-*` classes. These classes increase t In addition to column clearing at responsive breakpoints, you may need to reset offsets. See this in action in [the grid example]({{< docsref "/examples/grid" >}}). {{< example class="bd-example-row" >}} -
+
.col-sm-5 .col-md-6
.col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0
@@ -267,7 +267,7 @@ In addition to column clearing at responsive breakpoints, you may need to reset With the move to flexbox in v4, you can use margin utilities like `.me-auto` to force sibling columns away from one another. {{< example class="bd-example-row" >}} -
+
.col-md-4
.col-md-4 .ms-auto
diff --git a/site/content/docs/5.2/layout/css-grid.md b/site/content/docs/5.2/layout/css-grid.md index 4b0be3846202..397733c8a2f7 100644 --- a/site/content/docs/5.2/layout/css-grid.md +++ b/site/content/docs/5.2/layout/css-grid.md @@ -47,8 +47,8 @@ Compared to the default grid system: Three equal-width columns across all viewports and devices can be created by using the `.g-col-4` classes. Add [responsive classes](#responsive) to change the layout by viewport size. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-4
.g-col-4
.g-col-4
@@ -59,8 +59,8 @@ Three equal-width columns across all viewports and devices can be created by usi Use responsive classes to adjust your layout across viewports. Here we start with two columns on the narrowest viewports, and then grow to three columns on medium viewports and above. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6 .g-col-md-4
.g-col-6 .g-col-md-4
.g-col-6 .g-col-md-4
@@ -69,8 +69,8 @@ Use responsive classes to adjust your layout across viewports. Here we start wit Compare that to this two column layout at all viewports. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6
.g-col-6
@@ -80,8 +80,8 @@ Compare that to this two column layout at all viewports. Grid items automatically wrap to the next line when there's no more room horizontally. Note that the `gap` applies to horizontal and vertical gaps between grid items. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6
.g-col-6
@@ -94,8 +94,8 @@ Grid items automatically wrap to the next line when there's no more room horizon Start classes aim to replace our default grid's offset classes, but they're not entirely the same. CSS Grid creates a grid template through styles that tell browsers to "start at this column" and "end at this column." Those properties are `grid-column-start` and `grid-column-end`. Start classes are shorthand for the former. Pair them with the column classes to size and align your columns however you need. Start classes begin at `1` as `0` is an invalid value for these properties. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-3 .g-start-2
.g-col-4 .g-start-6
@@ -105,8 +105,8 @@ Start classes aim to replace our default grid's offset classes, but they're not When there are no classes on the grid items (the immediate children of a `.grid`), each grid item will automatically be sized to one column. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
1
1
1
@@ -124,8 +124,8 @@ When there are no classes on the grid items (the immediate children of a `.grid` This behavior can be mixed with grid column classes. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6
1
1
@@ -147,8 +147,8 @@ Similar to our default grid system, our CSS Grid allows for easy nesting of `.gr In practice this allows for more complex and custom layouts when compared to our default grid system. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
First auto-column
@@ -186,8 +186,8 @@ These CSS variables have no default value; instead, they apply fallback values t Immediate children elements of `.grid` are grid items, so they'll be sized without explicitly adding a `.g-col` class. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
Auto-column
Auto-column
Auto-column
@@ -198,15 +198,15 @@ Immediate children elements of `.grid` are grid items, so they'll be sized witho Adjust the number of columns and the gap. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-2
.g-col-2
{{< /example >}} -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6
.g-col-4
@@ -216,8 +216,8 @@ Adjust the number of columns and the gap. Adding more rows and changing the placement of columns: -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
Auto-column
Auto-column
Auto-column
@@ -228,8 +228,8 @@ Adding more rows and changing the placement of columns: Change the vertical gaps only by modifying the `row-gap`. Note that we use `gap` on `.grid`s, but `row-gap` and `column-gap` can be modified as needed. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6
.g-col-6
@@ -240,8 +240,8 @@ Change the vertical gaps only by modifying the `row-gap`. Note that we use `gap` Because of that, you can have different vertical and horizontal `gap`s, which can take a single value (all sides) or a pair of values (vertical and horizontal). This can be applied with an inline style for `gap`, or with our `--bs-gap` CSS variable. -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
.g-col-6
.g-col-6
@@ -259,8 +259,8 @@ One limitation of the CSS Grid is that our default classes are still generated b For example, you can increase the column count and change the gap size, and then size your "columns" with a mix of inline styles and predefined CSS Grid column classes (e.g., `.g-col-4`). -{{< example class="bd-example-cssgrid text-center" >}} -
+{{< example class="bd-example-cssgrid" >}} +
14 columns
.g-col-4
diff --git a/site/content/docs/5.2/layout/grid.md b/site/content/docs/5.2/layout/grid.md index 05fc1bd65db4..765b7eb60358 100644 --- a/site/content/docs/5.2/layout/grid.md +++ b/site/content/docs/5.2/layout/grid.md @@ -15,7 +15,7 @@ Bootstrap's grid system uses a series of containers, rows, and columns to layout {{< /callout >}} {{< example class="bd-example-row" >}} -
+
Column @@ -144,7 +144,7 @@ Utilize breakpoint-specific column classes for easy column sizing without an exp For example, here are two grid layouts that apply to every device and viewport, from `xs` to `xxl`. Add any number of unit-less classes for each breakpoint you need and every column will be the same width. {{< example class="bd-example-row" >}} -
+
1 of 2 @@ -172,7 +172,7 @@ For example, here are two grid layouts that apply to every device and viewport, Auto-layout for flexbox grid columns also means you can set the width of one column and have the sibling columns automatically resize around it. You may use predefined grid classes (as shown below), grid mixins, or inline widths. Note that the other columns will resize no matter the width of the center column. {{< example class="bd-example-row" >}} -
+
1 of 3 @@ -203,7 +203,7 @@ Auto-layout for flexbox grid columns also means you can set the width of one col Use `col-{breakpoint}-auto` classes to size columns based on the natural width of their content. {{< example class="bd-example-row" >}} -
+
1 of 3 @@ -238,7 +238,7 @@ Bootstrap's grid includes six tiers of predefined classes for building complex r For grids that are the same from the smallest of devices to the largest, use the `.col` and `.col-*` classes. Specify a numbered class when you need a particularly sized column; otherwise, feel free to stick to `.col`. {{< example class="bd-example-row" >}} -
+
col
col
@@ -257,7 +257,7 @@ For grids that are the same from the smallest of devices to the largest, use the Using a single set of `.col-sm-*` classes, you can create a basic grid system that starts out stacked and becomes horizontal at the small breakpoint (`sm`). {{< example class="bd-example-row" >}} -
+
col-sm-8
col-sm-4
@@ -275,7 +275,7 @@ Using a single set of `.col-sm-*` classes, you can create a basic grid system th Don't want your columns to simply stack in some grid tiers? Use a combination of different classes for each tier as needed. See the example below for a better idea of how it all works. {{< example class="bd-example-row" >}} -
+
.col-md-8
@@ -304,7 +304,7 @@ Use the responsive `.row-cols-*` classes to quickly set the number of columns th Use these row columns classes to quickly create basic grid layouts or to control your card layouts. {{< example class="bd-example-row" >}} -
+
Column
Column
@@ -315,7 +315,7 @@ Use these row columns classes to quickly create basic grid layouts or to control {{< /example >}} {{< example class="bd-example-row" >}} -
+
Column
Column
@@ -326,7 +326,7 @@ Use these row columns classes to quickly create basic grid layouts or to control {{< /example >}} {{< example class="bd-example-row" >}} -
+
Column
Column
@@ -337,7 +337,7 @@ Use these row columns classes to quickly create basic grid layouts or to control {{< /example >}} {{< example class="bd-example-row" >}} -
+
Column
Column
@@ -348,7 +348,7 @@ Use these row columns classes to quickly create basic grid layouts or to control {{< /example >}} {{< example class="bd-example-row" >}} -
+
Column
Column
@@ -359,7 +359,7 @@ Use these row columns classes to quickly create basic grid layouts or to control {{< /example >}} {{< example class="bd-example-row" >}} -
+
Column
Column
@@ -388,7 +388,7 @@ You can also use the accompanying Sass mixin, `row-cols()`: To nest your content with the default grid, add a new `.row` and set of `.col-sm-*` columns within an existing `.col-sm-*` column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns). {{< example class="bd-example-row" >}} -
+
Level 1: .col-sm-3 diff --git a/site/content/docs/5.2/layout/gutters.md b/site/content/docs/5.2/layout/gutters.md index 9ea13e4ab246..1cb68303f1ad 100644 --- a/site/content/docs/5.2/layout/gutters.md +++ b/site/content/docs/5.2/layout/gutters.md @@ -19,7 +19,7 @@ toc: true `.gx-*` classes can be used to control the horizontal gutter widths. The `.container` or `.container-fluid` parent may need to be adjusted if larger gutters are used too to avoid unwanted overflow, using a matching padding utility. For example, in the following example we've increased the padding with `.px-4`: {{< example >}} -
+
Custom column padding
@@ -34,7 +34,7 @@ toc: true An alternative solution is to add a wrapper around the `.row` with the `.overflow-hidden` class: {{< example >}} -
+
Custom column padding
@@ -51,7 +51,7 @@ An alternative solution is to add a wrapper around the `.row` with the `.overflo `.gy-*` classes can be used to control the vertical gutter widths. Like the horizontal gutters, the vertical gutters can cause some overflow below the `.row` at the end of a page. If this occurs, you add a wrapper around `.row` with the `.overflow-hidden` class: {{< example >}} -
+
Custom column padding
@@ -74,7 +74,7 @@ An alternative solution is to add a wrapper around the `.row` with the `.overflo `.g-*` classes can be used to control the horizontal gutter widths, for the following example we use a smaller gutter width, so there won't be a need to add the `.overflow-hidden` wrapper class. {{< example >}} -
+
Custom column padding
@@ -97,7 +97,7 @@ An alternative solution is to add a wrapper around the `.row` with the `.overflo Gutter classes can also be added to [row columns]({{< docsref "/layout/grid#row-columns" >}}). In the following example, we use responsive row columns and responsive gutter classes. {{< example >}} -
+
Row column
@@ -142,7 +142,7 @@ The gutters between columns in our predefined grid classes can be removed with ` In practice, here's how it looks. Note you can continue to use this with all other predefined grid classes (including column widths, responsive tiers, reorders, and more). {{< example class="bd-example-row" >}} -
+
.col-sm-6 .col-md-8
.col-6 .col-md-4