Reprence Html CSS javascript PHP MySQL Bootsrap

Columns

Learn how to modify columns with a handful of options for alignment, ordering, and offsetting thanks to our flexbox grid system. Plus, see how to use column classes to manage widths of non-grid elements.

Alignment

Use flexbox alignment utilities to vertically and horizontally align columns.

Vertical alignment

Change the vertical alignment with any of the responsive align-items-* classes.

columns1

columns2


columns3

Or, change the alignment of each column individually with any of the responsive .align-self-* classes.

clm4

Horizontal alignment

Change the horizontal alignment with any of the responsive justify-content-* classes.

clm5

Column wrapping

If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.

clm6

Column breaks

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 .rows, but not every implementation method can account for this.

clm7

You may also apply this break at specific breakpoints with our responsive display utilities.

clm8

Order classes

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. If you need more .order-* classes, you can modify the default number via Sass variable.

clm9

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.

clm10

Offsetting columns

You can offset grid columns in two ways: our responsive .offset- grid classes and our margin utilities. Grid classes are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable

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

clm11

In addition to column clearing at responsive breakpoints, you may need to reset offsets. See this in action in the grid example.


clm12

Margin utilities

With the move to flexbox in v4, you can use margin utilities like .me-auto to force sibling columns away from one another.

clm13

Standalone column classes

The .col-* classes can also be used outside a .row to give an element a specific width. Whenever column classes are used as non-direct children of a row, the paddings are omitted.

clm14

The classes can be used together with utilities to create responsive floated images. Make sure to wrap the content in a .clearfix wrapper to clear the float if the text is shorter.

clm15