<?php
	echo $colorSchema;
?>
$colors: (
    'grays': (
        '10': #f5f5f5,
        '20': #e3e3e3,
        '30': #ccc,
        '40': #b0b0b0,
        '50': #969696,
        '60': #787878,
        '70': #595959,
        '80': #3d3d3d,
        '90': #262626,
        '100': #121212,
        'white': #fff,
        'black': #000
    ),
    'first': ( // aka elementary or primary
        '10': #f5f8fe,
        '20': #d8e3fd,
        '40': #6993f7,
        '60': #0c4ce4,
        '70': #0939aa,
        '90': #041849,
        '100': #020b22
    ),
    'second': ( // aka complementary or secondary
        '20': #dcdafb,
        '40': #7971ef,
        '60': #2418d8,
        '70': #1a12a1,
        '90': #0b0845
    ),
    'alert': (
        '20': #fbdcda,
        '60': #e83d30
    ),
    'success': (
        '20': #def7e7,
        '60': #30c062
    ),
    'red': #e83d30,
    'green': #30c062,
    'orange': #f2a200,
    'white': #fff,
    'black': #000,
    'gray-light': #e3e3e3,
    'gray': #787878,
    'gray-dark': #595959,
    'gray-dark-extra': #3d3d3d,
    'shadow': transparentize(#000, .8),
    'brand-1': #0c4ce4
);

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Subtitle
Subtitle Bold

Body Normal
Body Normal Bold

Body Medium

Body Small
Body Small Bold
Caption
<?php foreach($sizes as $tag => $name) {
	$class = '';

	if (in_array($tag, $bolds)) {
		$name .= "<br><strong>{$name} Bold</strong>";
	}

	if (strpos($tag, '.') !== false) {
		$expandTag = explode('.', $tag);
		$tag = $expandTag[0];
		$class = $expandTag[1];
	}

	echo "<!-- TAG {$tag} -->\n<{$tag}" . (!empty($class) ? " class='font-{$class}'" : "") . ">{$name}</{$tag}>\n";
} ?>
$font-families: (
    'first': 'Inter, Arial, sans-serif' ('regular': 400, 'bold': 700)
);

$font-sizes: (
    huge: ( // aka headeing 1
        min: 32px,
        max: 72px
    ),
    big: ( // aka headeing 2
        min: 30px,
        max: 56px
    ),
    xx-large: ( // aka headeing 3
        min: 28px,
        max: 40px
    ),
    x-large: ( // aka headeing 4
        min: 26px,
        max: 32px
    ),
    large: 24px, // aka headeing 5
    lead: 20px 1.6, // aka headeing 6
    normal: 16px,
    medium: 14px 20px,
    small: 12px 16px
);

$font-loader: true;

$line-heights: (
    normal: 1.5
);

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.


  1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  2. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  3. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  4. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Company Contact Country
Alfreds Futterkiste Maria Anders Germany
Centro comercial Moctezuma Francisco Chang Mexico
Ernst Handel Roland Mendel Austria
Island Trading Helen Bennett UK
Laughing Bacchus Winecellars Yoshi Tannamuri Canada
Magazzini Alimentari Riuniti Giovanni Rovelli Italy
Lorem ipsum
<h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h1>

<h2>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h2>

<h3>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h3>

<h4>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h4>

<h5>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h5>

<h6>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h6>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>

<hr>

<ol>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
</ol>

<img src="https://placeimg.com/350/150/any">

<ul>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
	<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
</ul>

<table>
	<tr>
		<th>Company</th>
		<th>Contact</th>
		<th>Country</th>
	</tr>
	<tr>
		<td>Alfreds Futterkiste</td>
		<td>Maria Anders</td>
		<td>Germany</td>
	</tr>
	<tr>
		<td>Centro comercial Moctezuma</td>
		<td>Francisco Chang</td>
		<td>Mexico</td>
	</tr>
	<tr>
		<td>Ernst Handel</td>
		<td>Roland Mendel</td>
		<td>Austria</td>
	</tr>
	<tr>
		<td>Island Trading</td>
		<td>Helen Bennett</td>
		<td>UK</td>
	</tr>
	<tr>
		<td>Laughing Bacchus Winecellars</td>
		<td>Yoshi Tannamuri</td>
		<td>Canada</td>
	</tr>
	<tr>
		<td>Magazzini Alimentari Riuniti</td>
		<td>Giovanni Rovelli</td>
		<td>Italy</td>
	</tr>
</table>

<a href="#">Lorem ipsum</a>
html {

    font-size: 62.5%;

}

body {

    @include font-family(first);
    @include font-size(normal);
    color: color('primary', '90');

}

a {

    @include text-underline(none, underline);
    color: inherit;

    &[href^="tel:"] {

        @include text-underline(none);

    }

    &[href^="mailto:"] {

        word-break: break-all;

    }

}

h1,
.h1 {

    @include font-family(first, bold);
    @include font-size(huge);
    margin: em(48px 0, huge);

}

h2,
.h2 {

    @include font-family(first, bold);
    @include font-size(big);
    margin: em(48px 0, big);

}

h3,
.h3 {

    @include font-family(first, bold);
    @include font-size(xx-large);
    margin: em(48px 0, xx-large);

}

h4,
.h4 {

    @include font-family(first, bold);
    @include font-size(x-large);
    margin: em(48px 0, x-large);

}

h5,
.h5 {

    @include font-family(first, bold);
    @include font-size(large);
    margin: em(48px 0, large);

}

h6,
.h6 {

    @include font-family(first, regular);
    @include font-size(lead);
    margin: em(48px 0, lead);

}

p,
hr,
ul,
ol,
table,
blockquote {

    margin-bottom: space(2);
    margin-top: space(2);

}

small {

    @include font-size(small);

}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6,
p,
hr,
ul,
ol,
table,
blockquote {

    &:first-child {

        margin-top: 0;

    }

    &:last-child {

        margin-bottom: 0;

    }

}


ul,
ol {

    list-style-position: outside;
    margin-left: 1em;
    padding: 0;

    li {

        margin: 0;
        padding: 0;

        + li {

            margin-top: space(1);

        }

    }

}

ul {

    list-style-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cellipse fill='%23#{str-slice(#{color('red')}, 2)}' cx='4' cy='3' rx='3' ry='3'/%3E%3C/svg%3E");

}

hr {

    background: color('gray');
    border: 0;
    height: 1px;

}

table {

    &:not(.reset) {

        border-collapse: collapse;
        border-spacing: 0;
        width: 100%;

        th {

            background: color('gray-dark-extra');
            color: color('white');
            line-height: line-height(normal);
            text-align: left;

        }

        th,
        td {

            border: 0;
            padding: space(2);
            vertical-align: middle;

        }

        tr {

            &:nth-child(odd) {

                background: color('gray');

            }

            &:nth-child(even) {

                background: color('white');

            }

        }

        thead + tbody {

            tr {

                &:nth-child(odd) {

                    background: color('white');

                }

                &:nth-child(even) {

                    background: color('gray');

                }

            }

        }

    }

}
<?php
	echo $shadowRange;
?>
$shadows: (
    'small': '0 4px 8px -4px rgba(26, 26, 26, .16)',
    'medium': '0 12px 32px -8px rgba(26, 26, 26, .08)',
    'large': '0 24px 40px -4px rgba(26, 26, 26, .08)'
);

Enable flex behaviors

Apply display utilities to create a flexbox container and transform direct children elements into flex items. Flex containers and items are able to be modified further with additional flex properties.

I'm a flexbox container!
<div class="d-flex p-1">I'm a flexbox container!</div>

I'm an inline flexbox container!
<div class="d-inline-flex p-1">I'm an inline flexbox container!</div>

Responsive variations also exist for .d-flex and .d-inline-flex.

  • .d-flex
  • .d-inline-flex
  • .d-sm-flex
  • .d-sm-inline-flex
  • .d-md-flex
  • .d-md-inline-flex
  • .d-lg-flex
  • .d-lg-inline-flex
  • .d-xl-flex
  • .d-xl-inline-flex

Direction

Set the direction of flex items in a flex container with direction utilities. In most cases you can omit the horizontal class here as the browser default is row. However, you may encounter situations where you needed to explicitly set this value (like responsive layouts).

Use .flex-row to set a horizontal direction (the browser default), or .flex-row-reverse to start the horizontal direction from the opposite side.

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
<div class="d-flex flex-row">
	<div class="p-1">Flex item 1</div>
	<div class="p-1">Flex item 2</div>
	<div class="p-1">Flex item 3</div>
</div>
<div class="d-flex flex-row-reverse">
	<div class="p-1">Flex item 1</div>
	<div class="p-1">Flex item 2</div>
	<div class="p-1">Flex item 3</div>
</div>

Use .flex-column to set a vertical direction, or .flex-column-reverse to start the vertical direction from the opposite side.

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
<div class="d-flex flex-column">
	<div class="p-1">Flex item 1</div>
	<div class="p-1">Flex item 2</div>
	<div class="p-1">Flex item 3</div>
</div>
<div class="d-flex flex-column-reverse">
	<div class="p-1">Flex item 1</div>
	<div class="p-1">Flex item 2</div>
	<div class="p-1">Flex item 3</div>
</div>

Responsive variations also exist for flex-direction.

  • .flex-row
  • .flex-row-reverse
  • .flex-column
  • .flex-column-reverse
  • .flex-sm-row
  • .flex-sm-row-reverse
  • .flex-sm-column
  • .flex-sm-column-reverse
  • .flex-md-row
  • .flex-md-row-reverse
  • .flex-md-column
  • .flex-md-column-reverse
  • .flex-lg-row
  • .flex-lg-row-reverse
  • .flex-lg-column
  • .flex-lg-column-reverse
  • .flex-xl-row
  • .flex-xl-row-reverse
  • .flex-xl-column
  • .flex-xl-column-reverse

Justify content

Use justify-content utilities on flexbox containers to change the alignment of flex items on the main axis (the x-axis to start, y-axis if flex-direction: column). Choose from start (browser default), end, center, between, or around.

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
<div class="d-flex justify-content-start">...</div>
<div class="d-flex justify-content-end">...</div>
<div class="d-flex justify-content-center">...</div>
<div class="d-flex justify-content-between">...</div>
<div class="d-flex justify-content-around">...</div>

Responsive variations also exist for justify-content.

  • .justify-content-start
  • .justify-content-end
  • .justify-content-center
  • .justify-content-between
  • .justify-content-around
  • .justify-content-sm-start
  • .justify-content-sm-end
  • .justify-content-sm-center
  • .justify-content-sm-between
  • .justify-content-sm-around
  • .justify-content-md-start
  • .justify-content-md-end
  • .justify-content-md-center
  • .justify-content-md-between
  • .justify-content-md-around
  • .justify-content-lg-start
  • .justify-content-lg-end
  • .justify-content-lg-center
  • .justify-content-lg-between
  • .justify-content-lg-around
  • .justify-content-xl-start
  • .justify-content-xl-end
  • .justify-content-xl-center
  • .justify-content-xl-between
  • .justify-content-xl-around

Align items

Use align-items utilities on flexbox containers to change the alignment of flex items on the cross axis (the y-axis to start, x-axis if flex-direction: column). Choose from start, end, center, baseline, or stretch (browser default).

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
<div class="d-flex align-items-start">...</div>
<div class="d-flex align-items-end">...</div>
<div class="d-flex align-items-center">...</div>
<div class="d-flex align-items-baseline">...</div>
<div class="d-flex align-items-stretch">...</div>

Responsive variations also exist for align-items.

  • .align-items-start
  • .align-items-end
  • .align-items-center
  • .align-items-baseline
  • .align-items-stretch
  • .align-items-sm-start
  • .align-items-sm-end
  • .align-items-sm-center
  • .align-items-sm-baseline
  • .align-items-sm-stretch
  • .align-items-md-start
  • .align-items-md-end
  • .align-items-md-center
  • .align-items-md-baseline
  • .align-items-md-stretch
  • .align-items-lg-start
  • .align-items-lg-end
  • .align-items-lg-center
  • .align-items-lg-baseline
  • .align-items-lg-stretch
  • .align-items-xl-start
  • .align-items-xl-end
  • .align-items-xl-center
  • .align-items-xl-baseline
  • .align-items-xl-stretch

Align self

Use align-self utilities on flexbox items to individually change their alignment on the cross axis (the y-axis to start, x-axis if flex-direction: column). Choose from the same options as align-items: start, end, center, baseline, or stretch (browser default).

Flex item
Aligned flex item
Flex item
Flex item
Aligned flex item
Flex item
Flex item
Aligned flex item
Flex item
Flex item
Aligned flex item
Flex item
Flex item
Aligned flex item
Flex item
<div class="align-self-start">Aligned flex ite</div>
<div class="align-self-end">Aligned flex item</div>
<div class="align-self-center">Aligned flex item</div>
<div class="align-self-baseline">Aligned flex item</div>
<div class="align-self-stretch">Aligned flex item</div>

Responsive variations also exist for align-self.

  • .align-self-start
  • .align-self-end
  • .align-self-center
  • .align-self-baseline
  • .align-self-stretch
  • .align-self-sm-start
  • .align-self-sm-end
  • .align-self-sm-center
  • .align-self-sm-baseline
  • .align-self-sm-stretch
  • .align-self-md-start
  • .align-self-md-end
  • .align-self-md-center
  • .align-self-md-baseline
  • .align-self-md-stretch
  • .align-self-lg-start
  • .align-self-lg-end
  • .align-self-lg-center
  • .align-self-lg-baseline
  • .align-self-lg-stretch
  • .align-self-xl-start
  • .align-self-xl-end
  • .align-self-xl-center
  • .align-self-xl-baseline
  • .align-self-xl-stretch

Auto margins

Flexbox can do some pretty awesome things when you mix flex alignments with auto margins. Shown below are three examples of controlling flex items via auto margins: default (no auto margin), pushing two items to the right (.mr-auto), and pushing two items to the left (.ml-auto).

Unfortunately, IE10 and IE11 do not properly support auto margins on flex items whose parent has a non-default justify-content value.See this StackOverflow answer for more details.

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex">
	<div class="p-1">Flex item</div>
	<div class="p-1">Flex item</div>
	<div class="p-1">Flex item</div>
</div>

<div class="d-flex">
	<div class="mr-auto p-1">Flex item</div>
	<div class="p-1">Flex item</div>
	<div class="p-1">Flex item</div>
</div>

<div class="d-flex">
	<div class="p-1">Flex item</div>
	<div class="p-1">Flex item</div>
	<div class="ml-auto p-1">Flex item</div>
</div>

With align-items

Vertically move one flex item to the top or bottom of a container by mixing align-items, flex-direction: column, and margin-top: auto or margin-bottom: auto.

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-items-start flex-column mb-3">
	<div class="mb-auto p-1">Flex item</div>
	<div class="p-1">Flex item</div>
	<div class="p-1">Flex item</div>
</div>
<div class="d-flex align-items-end flex-column mb-3">
	<div class="p-1">Flex item</div>
	<div class="p-1">Flex item</div>
	<div class="mt-auto p-1">Flex item</div>
</div>

Wrap

Change how flex items wrap in a flex container. Choose from no wrapping at all (the browser default) with .flex-nowrap, wrapping with .flex-wrap, or reverse wrapping with .flex-wrap-reverse.

Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex flex-nowrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex flex-wrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex flex-wrap-reverse">
	...
</div>

Responsive variations also exist for flex-wrap.

  • .flex-nowrap
  • .flex-wrap
  • .flex-wrap-reverse
  • .flex-sm-nowrap
  • .flex-sm-wrap
  • .flex-sm-wrap-reverse
  • .flex-md-nowrap
  • .flex-md-wrap
  • .flex-md-wrap-reverse
  • .flex-lg-nowrap
  • .flex-lg-wrap
  • .flex-lg-wrap-reverse
  • .flex-xl-nowrap
  • .flex-xl-wrap
  • .flex-xl-wrap-reverse

Order

Change the visual order of specific flex items with a handful of order utilities. We only provide options for making an item first or last, as well as a reset to use the DOM order. As order takes any integer value (e.g., 5), add custom CSS for any additional values needed.

Third flex item
Second flex item
First flex item
<div class="d-flex flex-nowrap">
	<div class="order-3 p-1">First flex item</div>
	<div class="order-2 p-1">Second flex item</div>
	<div class="order-1 p-1">Third flex item</div>
</div>

Responsive variations also exist for order

  • .order-1
  • .order-2
  • .order-3
  • .order-4
  • .order-5
  • .order-6
  • .order-7
  • .order-8
  • .order-9
  • .order-10
  • .order-11
  • .order-12
  • .order-sm-1
  • .order-sm-2
  • .order-sm-3
  • .order-sm-4
  • .order-sm-5
  • .order-sm-6
  • .order-sm-7
  • .order-sm-8
  • .order-sm-9
  • .order-sm-10
  • .order-sm-11
  • .order-sm-12
  • .order-md-1
  • .order-md-2
  • .order-md-3
  • .order-md-4
  • .order-md-5
  • .order-md-6
  • .order-md-7
  • .order-md-8
  • .order-md-9
  • .order-md-10
  • .order-md-11
  • .order-md-12
  • .order-lg-1
  • .order-lg-2
  • .order-lg-3
  • .order-lg-4
  • .order-lg-5
  • .order-lg-6
  • .order-lg-7
  • .order-lg-8
  • .order-lg-9
  • .order-lg-10
  • .order-lg-11
  • .order-lg-12
  • .order-xl-1
  • .order-xl-2
  • .order-xl-3
  • .order-xl-4
  • .order-xl-5
  • .order-xl-6
  • .order-xl-7
  • .order-xl-8
  • .order-xl-9
  • .order-xl-10
  • .order-xl-11
  • .order-xl-12

Align content

Use align-content utilities on flexbox containers to align flex items together on the cross axis. Choose from start (browser default), end, center, between, around, or stretch. To demonstrate these utilities, we’ve enforced flex-wrap: wrap and increased the number of flex items.

Heads up! This property has no effect on single rows of flex items.

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-content-start flex-wrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-content-end flex-wrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-content-center flex-wrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-content-between flex-wrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-content-around flex-wrap">
	...
</div>

Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
Flex item
<div class="d-flex align-content-stretch flex-wrap">
	...
</div>

Responsive variations also exist for align-content.

  • .align-content-start
  • .align-content-end
  • .align-content-center
  • .align-content-around
  • .align-content-stretch
  • .align-content-sm-start
  • .align-content-sm-end
  • .align-content-sm-center
  • .align-content-sm-around
  • .align-content-sm-stretch
  • .align-content-md-start
  • .align-content-md-end
  • .align-content-md-center
  • .align-content-md-around
  • .align-content-md-stretch
  • .align-content-lg-start
  • .align-content-lg-end
  • .align-content-lg-center
  • .align-content-lg-around
  • .align-content-lg-stretch
  • .align-content-xl-start
  • .align-content-xl-end
  • .align-content-xl-center
  • .align-content-xl-around
  • .align-content-xl-stretch
<p><strong>Enable flex behaviors</strong></p>

<p>Apply <code>display</code> utilities to create a flexbox container and transform <strong>direct children elements</strong> into flex items. Flex containers and items are able to be modified further with additional flex properties.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-flex p-1 mdl-highlight">I'm a flexbox container!</div>
	</div>
	<pre>&lt;div class="d-flex p-1">I'm a flexbox container!&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-inline-flex p-1 mdl-highlight">I'm an inline flexbox container!</div>
	</div>
	<pre>&lt;div class="d-inline-flex p-1">I'm an inline flexbox container!&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>.d-flex</code> and <code>.d-inline-flex</code>.</p>

<ul>
	<li><code>.d-flex</code></li>
	<li><code>.d-inline-flex</code></li>
	<li><code>.d-sm-flex</code></li>
	<li><code>.d-sm-inline-flex</code></li>
	<li><code>.d-md-flex</code></li>
	<li><code>.d-md-inline-flex</code></li>
	<li><code>.d-lg-flex</code></li>
	<li><code>.d-lg-inline-flex</code></li>
	<li><code>.d-xl-flex</code></li>
	<li><code>.d-xl-inline-flex</code></li>
</ul>

<p><strong>Direction</strong></p>

<p>Set the direction of flex items in a flex container with direction utilities. In most cases you can omit the horizontal class here as the browser default is <code>row</code>. However, you may encounter situations where you needed to explicitly set this value (like responsive layouts).</p>

<p>Use <code>.flex-row</code> to set a horizontal direction (the browser default), or <code>.flex-row-reverse</code> to start the horizontal direction from the opposite side.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-flex flex-row mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex flex-row-reverse mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
<pre>&lt;div class="d-flex flex-row">
	&lt;div class="p-1">Flex item 1&lt;/div>
	&lt;div class="p-1">Flex item 2&lt;/div>
	&lt;div class="p-1">Flex item 3&lt;/div>
&lt;/div>
&lt;div class="d-flex flex-row-reverse">
	&lt;div class="p-1">Flex item 1&lt;/div>
	&lt;div class="p-1">Flex item 2&lt;/div>
	&lt;div class="p-1">Flex item 3&lt;/div>
&lt;/div></pre>
</div>

<p>Use <code>.flex-column</code> to set a vertical direction, or <code>.flex-column-reverse</code>  to start the vertical direction from the opposite side.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-flex flex-column mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex flex-column-reverse mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
<pre>&lt;div class="d-flex flex-column">
	&lt;div class="p-1">Flex item 1&lt;/div>
	&lt;div class="p-1">Flex item 2&lt;/div>
	&lt;div class="p-1">Flex item 3&lt;/div>
&lt;/div>
&lt;div class="d-flex flex-column-reverse">
	&lt;div class="p-1">Flex item 1&lt;/div>
	&lt;div class="p-1">Flex item 2&lt;/div>
	&lt;div class="p-1">Flex item 3&lt;/div>
&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>flex-direction</code>.</p>

<ul>
	<li><code>.flex-row</code></li>
	<li><code>.flex-row-reverse</code></li>
	<li><code>.flex-column</code></li>
	<li><code>.flex-column-reverse</code></li>
	<li><code>.flex-sm-row</code></li>
	<li><code>.flex-sm-row-reverse</code></li>
	<li><code>.flex-sm-column</code></li>
	<li><code>.flex-sm-column-reverse</code></li>
	<li><code>.flex-md-row</code></li>
	<li><code>.flex-md-row-reverse</code></li>
	<li><code>.flex-md-column</code></li>
	<li><code>.flex-md-column-reverse</code></li>
	<li><code>.flex-lg-row</code></li>
	<li><code>.flex-lg-row-reverse</code></li>
	<li><code>.flex-lg-column</code></li>
	<li><code>.flex-lg-column-reverse</code></li>
	<li><code>.flex-xl-row</code></li>
	<li><code>.flex-xl-row-reverse</code></li>
	<li><code>.flex-xl-column</code></li>
	<li><code>.flex-xl-column-reverse</code></li>
</ul>

<p><strong>Justify content</strong></p>

<p>Use <code>justify-content</code> utilities on flexbox containers to change the alignment of flex items on the main axis (the x-axis to start, y-axis if <code>flex-direction: column</code>). Choose from <code>start</code> (browser default), <code>end</code>, <code>center</code>, <code>between</code>, or <code>around</code>.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-flex justify-content-start mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex justify-content-end mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex justify-content-center mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex justify-content-between mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex justify-content-around mdl-highlight">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
<pre>&lt;div class="d-flex justify-content-start">...&lt;/div>
&lt;div class="d-flex justify-content-end">...&lt;/div>
&lt;div class="d-flex justify-content-center">...&lt;/div>
&lt;div class="d-flex justify-content-between">...&lt;/div>
&lt;div class="d-flex justify-content-around">...&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>justify-content</code>.</p>

<ul>
	<li><code>.justify-content-start</code></li>
	<li><code>.justify-content-end</code></li>
	<li><code>.justify-content-center</code></li>
	<li><code>.justify-content-between</code></li>
	<li><code>.justify-content-around</code></li>
	<li><code>.justify-content-sm-start</code></li>
	<li><code>.justify-content-sm-end</code></li>
	<li><code>.justify-content-sm-center</code></li>
	<li><code>.justify-content-sm-between</code></li>
	<li><code>.justify-content-sm-around</code></li>
	<li><code>.justify-content-md-start</code></li>
	<li><code>.justify-content-md-end</code></li>
	<li><code>.justify-content-md-center</code></li>
	<li><code>.justify-content-md-between</code></li>
	<li><code>.justify-content-md-around</code></li>
	<li><code>.justify-content-lg-start</code></li>
	<li><code>.justify-content-lg-end</code></li>
	<li><code>.justify-content-lg-center</code></li>
	<li><code>.justify-content-lg-between</code></li>
	<li><code>.justify-content-lg-around</code></li>
	<li><code>.justify-content-xl-start</code></li>
	<li><code>.justify-content-xl-end</code></li>
	<li><code>.justify-content-xl-center</code></li>
	<li><code>.justify-content-xl-between</code></li>
	<li><code>.justify-content-xl-around</code></li>
</ul>

<p><strong>Align items</strong></p>

<p>Use <code>align-items</code> utilities on flexbox containers to change the alignment of flex items on the cross axis (the y-axis to start, x-axis if <code>flex-direction: column</code>). Choose from <code>start</code>, <code>end</code>, <code>center</code>, <code>baseline</code>, or <code>stretch</code> (browser default).</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-flex align-items-start mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex align-items-end mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex align-items-center mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex align-items-baseline mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex align-items-stretch mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item 1</div>
			<div class="p-1 mdl-highlight">Flex item 2</div>
			<div class="p-1 mdl-highlight">Flex item 3</div>
		</div>
	</div>
<pre>&lt;div class="d-flex align-items-start">...&lt;/div>
&lt;div class="d-flex align-items-end">...&lt;/div>
&lt;div class="d-flex align-items-center">...&lt;/div>
&lt;div class="d-flex align-items-baseline">...&lt;/div>
&lt;div class="d-flex align-items-stretch">...&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>align-items</code>.</p>

<ul>
	<li><code>.align-items-start</code></li>
	<li><code>.align-items-end</code></li>
	<li><code>.align-items-center</code></li>
	<li><code>.align-items-baseline</code></li>
	<li><code>.align-items-stretch</code></li>
	<li><code>.align-items-sm-start</code></li>
	<li><code>.align-items-sm-end</code></li>
	<li><code>.align-items-sm-center</code></li>
	<li><code>.align-items-sm-baseline</code></li>
	<li><code>.align-items-sm-stretch</code></li>
	<li><code>.align-items-md-start</code></li>
	<li><code>.align-items-md-end</code></li>
	<li><code>.align-items-md-center</code></li>
	<li><code>.align-items-md-baseline</code></li>
	<li><code>.align-items-md-stretch</code></li>
	<li><code>.align-items-lg-start</code></li>
	<li><code>.align-items-lg-end</code></li>
	<li><code>.align-items-lg-center</code></li>
	<li><code>.align-items-lg-baseline</code></li>
	<li><code>.align-items-lg-stretch</code></li>
	<li><code>.align-items-xl-start</code></li>
	<li><code>.align-items-xl-end</code></li>
	<li><code>.align-items-xl-center</code></li>
	<li><code>.align-items-xl-baseline</code></li>
	<li><code>.align-items-xl-stretch</code></li>
</ul>

<p><strong>Align self</strong></p>

<p>Use <code>align-self</code> utilities on flexbox items to individually change their alignment on the cross axis (the y-axis to start, x-axis if <code>flex-direction: column</code>). Choose from the same options as <code>align-items</code>: <code>start</code>, <code>end</code>, <code>center</code>, <code>baseline</code>, or <code>stretch</code> (browser default).</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="d-flex mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item</div>
			<div class="p-1 align-self-start mdl-highlight">Aligned flex item</div>
			<div class="p-1 mdl-highlight">Flex item</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item</div>
			<div class="p-1 align-self-end mdl-highlight">Aligned flex item</div>
			<div class="p-1 mdl-highlight">Flex item</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item</div>
			<div class="p-1 align-self-center mdl-highlight">Aligned flex item</div>
			<div class="p-1 mdl-highlight">Flex item</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item</div>
			<div class="p-1 align-self-baseline mdl-highlight">Aligned flex item</div>
			<div class="p-1 mdl-highlight">Flex item</div>
		</div>
	</div>
	<div class="mdl-example-inner">
		<div class="d-flex mdl-highlight" style="height: 100px">
			<div class="p-1 mdl-highlight">Flex item</div>
			<div class="p-1 align-self-stretch mdl-highlight">Aligned flex item</div>
			<div class="p-1 mdl-highlight">Flex item</div>
		</div>
	</div>
<pre>&lt;div class="align-self-start">Aligned flex ite&lt;/div>
&lt;div class="align-self-end">Aligned flex item&lt;/div>
&lt;div class="align-self-center">Aligned flex item&lt;/div>
&lt;div class="align-self-baseline">Aligned flex item&lt;/div>
&lt;div class="align-self-stretch">Aligned flex item&lt;/div>
</pre>
</div>

<p>Responsive variations also exist for <code>align-self</code>.</p>

<ul>
	<li><code>.align-self-start</code></li>
	<li><code>.align-self-end</code></li>
	<li><code>.align-self-center</code></li>
	<li><code>.align-self-baseline</code></li>
	<li><code>.align-self-stretch</code></li>
	<li><code>.align-self-sm-start</code></li>
	<li><code>.align-self-sm-end</code></li>
	<li><code>.align-self-sm-center</code></li>
	<li><code>.align-self-sm-baseline</code></li>
	<li><code>.align-self-sm-stretch</code></li>
	<li><code>.align-self-md-start</code></li>
	<li><code>.align-self-md-end</code></li>
	<li><code>.align-self-md-center</code></li>
	<li><code>.align-self-md-baseline</code></li>
	<li><code>.align-self-md-stretch</code></li>
	<li><code>.align-self-lg-start</code></li>
	<li><code>.align-self-lg-end</code></li>
	<li><code>.align-self-lg-center</code></li>
	<li><code>.align-self-lg-baseline</code></li>
	<li><code>.align-self-lg-stretch</code></li>
	<li><code>.align-self-xl-start</code></li>
	<li><code>.align-self-xl-end</code></li>
	<li><code>.align-self-xl-center</code></li>
	<li><code>.align-self-xl-baseline</code></li>
	<li><code>.align-self-xl-stretch</code></li>
</ul>

<p><strong>Auto margins</strong></p>

<p>Flexbox can do some pretty awesome things when you mix flex alignments with auto margins. Shown below are three examples of controlling flex items via auto margins: default (no auto margin), pushing two items to the right (<code>.mr-auto</code>), and pushing two items to the left (<code>.ml-auto</code>).</p>

<p><strong>Unfortunately, IE10 and IE11 do not properly support auto margins on flex items whose parent has a non-default <code>justify-content</code> value.</strong><a href="https://stackoverflow.com/a/37535548">See this StackOverflow answer</a> for more details.</p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex mb-3 mdl-highlight">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>

        <div class="d-flex mb-3 mdl-highlight">
            <div class="mr-auto p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>

        <div class="d-flex mb-3 mdl-highlight">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="ml-auto p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
	<pre>&lt;div class="d-flex">
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
&lt;/div>

&lt;div class="d-flex">
	&lt;div class="mr-auto p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
&lt;/div>

&lt;div class="d-flex">
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="ml-auto p-1">Flex item&lt;/div>
&lt;/div></pre>
</div>

<p><strong>With align-items</strong></p>

<p>Vertically move one flex item to the top or bottom of a container by mixing <code>align-items</code>, <code>flex-direction: column</code>, and <code>margin-top: auto</code> or <code>margin-bottom: auto</code>.</p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-items-start flex-column mb-3 mdl-highlight" style="height: 200px;">
            <div class="mb-auto p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
        <div class="d-flex align-items-end flex-column mb-3 mdl-highlight" style="height: 200px;">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="mt-auto p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-items-start flex-column mb-3">
	&lt;div class="mb-auto p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
&lt;/div>
&lt;div class="d-flex align-items-end flex-column mb-3">
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="p-1">Flex item&lt;/div>
	&lt;div class="mt-auto p-1">Flex item&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Wrap</strong></p>

<p>Change how flex items wrap in a flex container. Choose from no wrapping at all (the browser default) with <code>.flex-nowrap</code>, wrapping with <code>.flex-wrap</code>, or reverse wrapping with <code>.flex-wrap-reverse</code>.</p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex flex-nowrap mdl-highlight" style="width: 14rem;">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex flex-nowrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex flex-wrap">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex flex-wrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex flex-wrap-reverse">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex flex-wrap-reverse">
	...
&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>flex-wrap</code>.</p>

<ul>
	<li><code>.flex-nowrap</code></li>
	<li><code>.flex-wrap</code></li>
	<li><code>.flex-wrap-reverse</code></li>
	<li><code>.flex-sm-nowrap</code></li>
	<li><code>.flex-sm-wrap</code></li>
	<li><code>.flex-sm-wrap-reverse</code></li>
	<li><code>.flex-md-nowrap</code></li>
	<li><code>.flex-md-wrap</code></li>
	<li><code>.flex-md-wrap-reverse</code></li>
	<li><code>.flex-lg-nowrap</code></li>
	<li><code>.flex-lg-wrap</code></li>
	<li><code>.flex-lg-wrap-reverse</code></li>
	<li><code>.flex-xl-nowrap</code></li>
	<li><code>.flex-xl-wrap</code></li>
	<li><code>.flex-xl-wrap-reverse</code></li>
</ul>

<p><strong>Order</strong></p>

<p>Change the visual order of specific flex items with a handful of <code>order</code> utilities. We only provide options for making an item first or last, as well as a reset to use the DOM order. As <code>order</code> takes any integer value (e.g., <code>5</code>), add custom CSS for any additional values needed.</p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex flex-nowrap">
            <div class="order-1 p-1 mdl-highlight">Third flex item</div>
            <div class="order-2 p-1 mdl-highlight">Second flex item</div>
            <div class="order-3 p-1 mdl-highlight">First flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex flex-nowrap">
	&lt;div class="order-3 p-1">First flex item&lt;/div>
	&lt;div class="order-2 p-1">Second flex item&lt;/div>
	&lt;div class="order-1 p-1">Third flex item&lt;/div>
&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>order</code></p>

<ul>
	<li><code>.order-1</code></li>
	<li><code>.order-2</code></li>
	<li><code>.order-3</code></li>
	<li><code>.order-4</code></li>
	<li><code>.order-5</code></li>
	<li><code>.order-6</code></li>
	<li><code>.order-7</code></li>
	<li><code>.order-8</code></li>
	<li><code>.order-9</code></li>
	<li><code>.order-10</code></li>
	<li><code>.order-11</code></li>
	<li><code>.order-12</code></li>
	<li><code>.order-sm-1</code></li>
	<li><code>.order-sm-2</code></li>
	<li><code>.order-sm-3</code></li>
	<li><code>.order-sm-4</code></li>
	<li><code>.order-sm-5</code></li>
	<li><code>.order-sm-6</code></li>
	<li><code>.order-sm-7</code></li>
	<li><code>.order-sm-8</code></li>
	<li><code>.order-sm-9</code></li>
	<li><code>.order-sm-10</code></li>
	<li><code>.order-sm-11</code></li>
	<li><code>.order-sm-12</code></li>
	<li><code>.order-md-1</code></li>
	<li><code>.order-md-2</code></li>
	<li><code>.order-md-3</code></li>
	<li><code>.order-md-4</code></li>
	<li><code>.order-md-5</code></li>
	<li><code>.order-md-6</code></li>
	<li><code>.order-md-7</code></li>
	<li><code>.order-md-8</code></li>
	<li><code>.order-md-9</code></li>
	<li><code>.order-md-10</code></li>
	<li><code>.order-md-11</code></li>
	<li><code>.order-md-12</code></li>
	<li><code>.order-lg-1</code></li>
	<li><code>.order-lg-2</code></li>
	<li><code>.order-lg-3</code></li>
	<li><code>.order-lg-4</code></li>
	<li><code>.order-lg-5</code></li>
	<li><code>.order-lg-6</code></li>
	<li><code>.order-lg-7</code></li>
	<li><code>.order-lg-8</code></li>
	<li><code>.order-lg-9</code></li>
	<li><code>.order-lg-10</code></li>
	<li><code>.order-lg-11</code></li>
	<li><code>.order-lg-12</code></li>
	<li><code>.order-xl-1</code></li>
	<li><code>.order-xl-2</code></li>
	<li><code>.order-xl-3</code></li>
	<li><code>.order-xl-4</code></li>
	<li><code>.order-xl-5</code></li>
	<li><code>.order-xl-6</code></li>
	<li><code>.order-xl-7</code></li>
	<li><code>.order-xl-8</code></li>
	<li><code>.order-xl-9</code></li>
	<li><code>.order-xl-10</code></li>
	<li><code>.order-xl-11</code></li>
	<li><code>.order-xl-12</code></li>
</ul>

<p><strong>Align content</strong></p>

<p>Use <code>align-content</code> utilities on flexbox containers to align flex items together on the cross axis. Choose from <code>start</code> (browser default), <code>end</code>, <code>center</code>, <code>between</code>, <code>around</code>, or <code>stretch</code>. To demonstrate these utilities, we’ve enforced <code>flex-wrap: wrap</code> and increased the number of flex items.</p>
<p><strong>Heads up!</strong> This property has no effect on single rows of flex items.</p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-content-start flex-wrap mb-3 mdl-highlight" style="height: 200px">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-content-start flex-wrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-content-end flex-wrap mb-3 mdl-highlight" style="height: 200px">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-content-end flex-wrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-content-center flex-wrap mb-3 mdl-highlight" style="height: 200px">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-content-center flex-wrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-content-between flex-wrap mb-3 mdl-highlight" style="height: 200px">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-content-between flex-wrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-content-around flex-wrap mb-3 mdl-highlight" style="height: 200px">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-content-around flex-wrap">
	...
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="container">
        <div class="d-flex align-content-stretch flex-wrap mb-3 mdl-highlight" style="height: 200px">
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
            <div class="p-1 mdl-highlight">Flex item</div>
        </div>
	</div>
<pre>&lt;div class="d-flex align-content-stretch flex-wrap">
	...
&lt;/div></pre>
</div>

<p>Responsive variations also exist for <code>align-content</code>.</p>

<ul>
	<li><code>.align-content-start</code></li>
	<li><code>.align-content-end</code></li>
	<li><code>.align-content-center</code></li>
	<li><code>.align-content-around</code></li>
	<li><code>.align-content-stretch</code></li>
	<li><code>.align-content-sm-start</code></li>
	<li><code>.align-content-sm-end</code></li>
	<li><code>.align-content-sm-center</code></li>
	<li><code>.align-content-sm-around</code></li>
	<li><code>.align-content-sm-stretch</code></li>
	<li><code>.align-content-md-start</code></li>
	<li><code>.align-content-md-end</code></li>
	<li><code>.align-content-md-center</code></li>
	<li><code>.align-content-md-around</code></li>
	<li><code>.align-content-md-stretch</code></li>
	<li><code>.align-content-lg-start</code></li>
	<li><code>.align-content-lg-end</code></li>
	<li><code>.align-content-lg-center</code></li>
	<li><code>.align-content-lg-around</code></li>
	<li><code>.align-content-lg-stretch</code></li>
	<li><code>.align-content-xl-start</code></li>
	<li><code>.align-content-xl-end</code></li>
	<li><code>.align-content-xl-center</code></li>
	<li><code>.align-content-xl-around</code></li>
	<li><code>.align-content-xl-stretch</code></li>
  </ul>
// stylelint-disable declaration-no-important

// Flex variation
//
// Custom styles for additional flex alignment options.

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    .flex#{$infix}-row            { flex-direction: row !important; }
    .flex#{$infix}-column         { flex-direction: column !important; }
    .flex#{$infix}-row-reverse    { flex-direction: row-reverse !important; }
    .flex#{$infix}-column-reverse { flex-direction: column-reverse !important; }

    .flex#{$infix}-wrap         { flex-wrap: wrap !important; }
    .flex#{$infix}-nowrap       { flex-wrap: nowrap !important; }
    .flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }
    .flex#{$infix}-fill         { flex: 1 1 auto !important; }
    .flex#{$infix}-grow-0       { flex-grow: 0 !important; }
    .flex#{$infix}-grow-1       { flex-grow: 1 !important; }
    .flex#{$infix}-shrink-0     { flex-shrink: 0 !important; }
    .flex#{$infix}-shrink-1     { flex-shrink: 1 !important; }

    .justify-content#{$infix}-start   { justify-content: flex-start !important; }
    .justify-content#{$infix}-end     { justify-content: flex-end !important; }
    .justify-content#{$infix}-center  { justify-content: center !important; }
    .justify-content#{$infix}-between { justify-content: space-between !important; }
    .justify-content#{$infix}-around  { justify-content: space-around !important; }

    .align-items#{$infix}-start    { align-items: flex-start !important; }
    .align-items#{$infix}-end      { align-items: flex-end !important; }
    .align-items#{$infix}-center   { align-items: center !important; }
    .align-items#{$infix}-baseline { align-items: baseline !important; }
    .align-items#{$infix}-stretch  { align-items: stretch !important; }

    .align-content#{$infix}-start   { align-content: flex-start !important; }
    .align-content#{$infix}-end     { align-content: flex-end !important; }
    .align-content#{$infix}-center  { align-content: center !important; }
    .align-content#{$infix}-between { align-content: space-between !important; }
    .align-content#{$infix}-around  { align-content: space-around !important; }
    .align-content#{$infix}-stretch { align-content: stretch !important; }

    .align-self#{$infix}-auto     { align-self: auto !important; }
    .align-self#{$infix}-start    { align-self: flex-start !important; }
    .align-self#{$infix}-end      { align-self: flex-end !important; }
    .align-self#{$infix}-center   { align-self: center !important; }
    .align-self#{$infix}-baseline { align-self: baseline !important; }
    .align-self#{$infix}-stretch  { align-self: stretch !important; }
  }
}

Containers

Containers are the most basic layout element and are required when using our default grid system. Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it’s 100% wide all the time).

While containers can be nested, most layouts do not require a nested container.

<div class="container">
	<!-- Content here -->
</div>

Use .container-fluid for a full width container, spanning the entire width of the viewport.

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

Responsive breakpoints

Since Bootstrap is developed to be mobile first, we use a handful of media queries to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.

Bootstrap primarily uses the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components.

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

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }

// Extra large devices (large desktops, 1280px and up)
@media (min-width: 1280px) { ... }

Since we write our source CSS in Sass, all our media queries are available via Sass function:

.some-class {
	@media(min-width: breakpoint-min(md)) {
		display: block;
	}
}

We occasionally use media queries that go in the other direction (the given screen size or smaller):

// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575px) { ... }

// Small devices (landscape phones, less than 768px)
@media (max-width: 767px) { ... }

// Medium devices (tablets, less than 992px)
@media (max-width: 991px) { ... }

// Large devices (desktops, less than 1200px)
@media (max-width: 1199px) { ... }

// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width

Once again, these media queries are also available via Sass function:

.some-class {
	@media(min-width: breakpoint-max(md)) {
		...
	}
}

There are also media queries in Sass mixins:

@include media-breakpoint-up(xl) { ... }
@include media-breakpoint-down(lg) { ... }
@include media-breakpoint-only(xl) { ... }
@include media-breakpoint-between(md, xl) { ... }

Grid

Bootstrap’s grid system uses a series of containers, rows, and columns to layout and align content. It’s built with flexbox and is fully responsive. Below is an example and an in-depth look at how the grid comes together.

New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, terminology, guidelines, and code snippets.

One of three columns
One of three columns
One of three columns
<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>

The above example creates three equal-width columns on small, medium, large, and extra large devices using our predefined grid classes. Those columns are centered in the page with the parent .container.

Breaking it down, here’s how it works:

  • Containers provide a means to center and horizontally pad your site’s contents. Use .container for a responsive pixel width or .container-fluid for width: 100% across all viewport and device sizes.
  • Rows are wrappers for columns. Each column has horizontal padding (called a gutter) for controlling the space between them. This padding is then counteracted on the rows with negative margins. This way, all the content in your columns is visually aligned down the left side.
  • In a grid layout, content must be placed within columns and only columns may be immediate children of rows.
  • Thanks to flexbox, grid columns without a specified width will automatically layout as equal width columns. For example, four instances of .col-sm will each automatically be 25% wide from the small breakpoint and up. See the auto-layout columns section for more examples.
  • Column classes indicate the number of columns you’d like to use out of the possible 12 per row. So, if you want three equal-width columns across, you can use .col-4.
  • Column widths are set in percentages, so they’re always fluid and sized relative to their parent element.
  • Columns have horizontal padding to create the gutters between individual columns, however, you can remove the margin from rows and padding from columns with .no-gutters on the .row.
  • To make the grid responsive, there are five grid breakpoints, one for each responsive breakpoint: all breakpoints (extra small), small, medium, large, and extra large.
  • Grid breakpoints are based on minimum width media queries, meaning they apply to that one breakpoint and all those above it (e.g., .col-sm-4 applies to small, medium, large, and extra large devices, but not the first xs breakpoint).
  • You can use predefined grid classes (like .col-4) or Sass mixins for more semantic markup.

Be aware of the limitations and bugs around flexbox, like the inability to use some HTML elements as flex containers.

Grid options

While Bootstrap uses ems or rems for defining most sizes, pxs are used for grid breakpoints and container widths. This is because the viewport width is in pixels and does not change with the font size.

See how aspects of the Bootstrap grid system work across multiple devices with a handy table.

Extra small
<576px
Small
≥576px
Medium
≥768px
Large
≥992px
Extra large
≥1200px
Max container width None (auto) 540px 720px 960px 1140px
Class prefix .col- .col-sm- .col-md- .col-lg- .col-xl-
# of columns 12
Gutter width 30px (15px on each side of a column)
Nestable Yes
Column ordering Yes

Auto-layout columns

Utilize breakpoint-specific column classes for easy column sizing without an explicit numbered class like .col-sm-6.

Equal-width

For example, here are two grid layouts that apply to every device and viewport, from xs to xl. Add any number of unit-less classes for each breakpoint you need and every column will be the same width.

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>

Equal-width columns can be broken into multiple lines, but there was a Safari flexbox bug that prevented this from working without an explicit flex-basis or border. There are workarounds for older browser versions, but they shouldn’t be necessary if you’re up-to-date.

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

Setting one column width

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.

1 of 3
2 of 3 (wider)
3 of 3
1 of 3
2 of 3 (wider)
3 of 3
<div class="container">
	<div class="row">
		<div class="col">
			1 of 3
		</div>
		<div class="col-12">
			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-10">
			2 of 3 (wider)
		</div>
		<div class="col">
			3 of 3
		</div>
	</div>
</div>

Variable width content

Use col-{breakpoint}-auto classes to size columns based on the natural width of their content.

1 of 3
Variable width content
3 of 3
1 of 3
Variable width 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>

Equal-width multi-row

Create equal-width columns that span multiple rows by inserting a .w-100 where you want the columns to break to a new line. Make the breaks responsive by mixing the .w-100 with some responsive display utilities.

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

Responsive classes

Bootstrap’s grid includes five tiers of predefined classes for building complex responsive layouts. Customize the size of your columns on extra small, small, medium, large, or extra large devices however you see fit.

All breakpoints

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.

.col
.col
.col
.col
.col-16
.col-8
<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-16">.col-16</div>
	<div class="col-8">.col-8</div>
</div>

Stacked to horizontal

Using a single set of .col-sm-* classes, you can create a basic grid system that starts out stacked before becoming horizontal with at the small breakpoint (sm).

.col-sm-16
.col-sm-8
.col-sm
.col-sm
.col-sm
<div class="row">
		<div class="col-sm-8">.col-sm-16</div>
		<div class="col-sm-4">.col-sm-8</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>

Mix and match

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.

.col-24 .col-md-16
.col-12 .col-md-8
.col-12 .col-md-8
.col-12 .col-md-8
.col-12 .col-md-8
.col-12
.col-12
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
	<div class="col-24 col-md-16">.col-12 .col-md-16</div>
	<div class="col-12 col-md-8">.col-12 .col-md-8</div>
</div>
<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
<div class="row">
	<div class="col-12 col-md-8">.col-12 .col-md-8</div>
	<div class="col-12 col-md-8">.col-12 .col-md-8</div>
	<div class="col-12 col-md-8">.col-12 .col-md-8</div>
</div>
<!-- Columns are always 50% wide, on mobile and desktop -->
<div class="row">
	<div class="col-12">.col-12</div>
	<div class="col-12">.col-12</div>
</div>

Alignment

Use flexbox alignment utilities to vertically and horizontally align columns.

Vertical alignment

One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
<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>

One of three columns
One of three columns
One of three columns
<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>

Horizontal alignment

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

No gutters

The gutters between columns in our predefined grid classes can be removed with .no-gutters. This removes the negative margins from .row and the horizontal padding from all immediate children columns.

Here’s the source code for creating these styles. Note that column overrides are scoped to only the first children columns and are targeted via attribute selector. While this generates a more specific selector, column padding can still be further customized with spacing utilities.

Need an edge-to-edge design? Drop the parent .container or .container-fluid.

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

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

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

Line gutters

Line gutters has the same usege as no-gutters, so class is added to row. This removes default gutter spacing from all immediate children columns and add 1px margin-top and 1px padding-left.

.line-gutters {
	margin: -1px 0 0 -1px;

	& > .col,
	& > [class*="col-"] {
		margin-bottom: 0;
		margin-top: 1px;
		padding-left: 1px;
		padding-right: 0;
	}
}

.col-24 .col-sm-12 .col-md-6
.col-24 .col-sm-12 .col-md-6
.col-12 .col-md-6
.col-12 .col-md-6
<div class="row line-gutters">
    <div class="col-24 col-sm-12 col-md-6">.col-24 .col-sm-12 .col-md-6</div>
    <div class="col-24 col-sm-12 col-md-6">.col-24 .col-sm-12 .col-md-6</div>
    <div class="col-12 col-md-6">.col-12 .col-md-6</div>
    <div class="col-12 col-md-6">.col-12 .col-md-6</div>
</div>

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.

.col-18
.col-8
Since 18 + 8 = 26 > 24, this 8-column-wide div gets wrapped onto a new line as one contiguous unit.
.col-12
Subsequent columns continue along the new line.
<div class="row">
	<div class="col-18">.col-18</div>
	<div class="col-8">.col-8<br>Since 18 + 8 = 26 > 24, this 8-column-wide div gets wrapped onto a new line as one contiguous unit.</div>
	<div class="col-12">.col-12<br>Subsequent columns continue along the new line.</div>
</div>

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.

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

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

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

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

.col-12 .col-sm-8
.col-12 .col-sm-8
.col-12 .col-sm-8
.col-12 .col-sm-8
<div class="row">
	<div class="col-12 col-sm-8">.col-12 .col-sm-8</div>
	<div class="col-12 col-sm-8">.col-12 .col-sm-8</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-12 col-sm-8">.col-12 .col-sm-8</div>
	<div class="col-12 col-sm-8">.col-12 .col-sm-8</div>
</div>

Reordering

Reordering 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 24 across all five grid tiers.

First, but unordered
Second, but last
Third, but first
<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>

There are also responsive .order-first and .order-last classes that change the order of an element by applying order: -1 and order: 13 (order: $columns + 1), respectively. These classes can also be intermixed with the numbered .order-* classes as needed.

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-8 moves .col-md-8 over four columns.

.col-md-8
.col-md-16 .offset-md-16
.col-md-6 .offset-md-6
.col-md-6 .offset-md-6
.col-md-12 .offset-md-6
<div class="row">
	<div class="col-md-8">.col-md-8</div>
	<div class="col-md-8 offset-md-8">.col-md-8 .offset-md-8</div>
</div>
<div class="row">
	<div class="col-md-6 offset-md-6">.col-md-6 .offset-md-6</div>
	<div class="col-md-6 offset-md-6">.col-md-6 .offset-md-6</div>
</div>
<div class="row">
	<div class="col-md-12 offset-md-6">.col-md-12 .offset-md-6</div>
</div>

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

.col-sm-10 .col-md-12
.col-sm-10 .offset-sm-4 .col-md-12 .offset-md-0
.col-sm-12 .col-md-10 .col-lg-12
.col-sm-12 .col-md-10 .offset-md-4 .col-lg-12 .offset-lg-0
<div class="row">
  <div class="col-sm-10 col-md-12">.col-sm-10 .col-md-12</div>
  <div class="col-sm-10 offset-sm-4 col-md-12 offset-md-0">.col-sm-10 .offset-sm-4 .col-md-12 .offset-md-0</div>
</div>
	
<div class="row">
  <div class="col-sm-12 col-md-10 col-lg-12">.col-sm-12 .col-md-10 .col-lg-12</div>
  <div class="col-sm-12 col-md-10 offset-md-4 col-lg-12 offset-lg-0">.col-sm-12 .col-md-10 .offset-md-4 .col-lg-12 .offset-lg-0</div>
</div>

Margin utilities

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

.col-md-8
.col-md-8 .ml-auto
.col-md-6 .ml-md-auto
.col-md-6 .ml-md-auto
.col-auto .mr-auto
.col-auto
<div class="row">
	<div class="col-md-8">.col-md-8</div>
	<div class="col-md-8 ml-auto">.col-md-8 .ml-auto</div>
</div>
<div class="row">
	<div class="col-md-6 ml-md-auto">.col-md-6 .ml-md-auto</div>
	<div class="col-md-6 ml-md-auto">.col-md-6 .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>

Nesting

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

Level 1: .col-sm-18
Level 2: .col-16 .col-sm-12
Level 2: .col-8 .col-sm-12
<div class="row">
	<div class="col-sm-18">
		Level 1: .col-sm-18
		<div class="row">
		<div class="col-16 col-sm-12">
			Level 2: .col-16 .col-sm-12
		</div>
		<div class="col-8 col-sm-12">
			Level 2: .col-8 .col-sm-12
		</div>
		</div>
	</div>
</div>

Sass mixins

When using Bootstrap’s source Sass files, you have the option of using Sass variables and mixins to create custom, semantic, and responsive page layouts. Our predefined grid classes use these same variables and mixins to provide a whole suite of ready-to-use classes for fast responsive layouts.

Variables

Variables and maps determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.

$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 are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.

// 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);

Example usage

You can modify the variables to your own custom values, or just use the mixins with their default values. Here’s an example of using the default settings to create a two-column layout with a gap between.

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

Main content
Secondary 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>

Customizing the grid

Using our built-in grid Sass variables and maps, it’s possible to completely customize the predefined grid classes. Change the number of tiers, the media query dimensions, and the container widths—then recompile.

Columns and gutters

The number of grid columns can be modified via Sass variables. $grid-columns is used to generate the widths (in percent) of each individual column while $grid-gutter-width allows breakpoint-specific widths that are divided evenly across padding-left and padding-right for the column gutters.

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

Grid tiers

Moving beyond the columns themselves, you may also customize the number of grid tiers. If you wanted just four grid tiers, you’d update the $grid-breakpoints and $container-max-widths to something like this:

$grid-breakpoints: (
	xs: 0,
	sm: 480px,
	md: 768px,
	lg: 1024px
);
	
$container-max-widths: (
	sm: 420px,
	md: 720px,
	lg: 960px
);

When making any changes to the Sass variables or maps, you’ll need to save your changes and recompile. Doing so will output a brand new set of predefined grid classes for column widths, offsets, and ordering. Responsive visibility utilities will also be updated to use the custom breakpoints. Make sure to set grid values in px (not rem, em, or %).

<p><strong>Containers</strong></p>

<p>Containers are the most basic layout element and are <strong>required when using our default grid system</strong>. Choose from a responsive, fixed-width container (meaning its <code>max-width</code> changes at each breakpoint) or fluid-width (meaning it’s <code>100%</code> wide all the time).</p>

<p>While containers can be nested, most layouts do not require a nested container.</p>

<div class="mdl-example">
	<div class="container a-max-width-sm">
		<div class="row">
			<div class="col-18"><div style="background-color: #957bbe; border-radius: 4px; height: 125px"></div></div>
			<div class="col-6"><div style="background-color: #80bdff; border-radius: 4px; height: 125px"></div></div>
		</div>
	</div>
	<pre>&lt;div class="container">
	&lt;!-- Content here -->
&lt;/div></pre>
</div>

<p>Use .container-fluid for a full width container, spanning the entire width of the viewport.</p>

<div class="mdl-example">
	<div class="container-fluid">
		<div class="row">
			<div class="col-18"><div style="background-color: #957bbe; border-radius: 4px; height: 125px"></div></div>
			<div class="col-6"><div style="background-color: #80bdff; border-radius: 4px; height: 125px"></div></div>
		</div>
	</div>
	<pre>&lt;div class="container-fluid">
	...
&lt;/div></pre>
</div>

<p><strong>Responsive breakpoints</strong></p>

<p>Since Bootstrap is developed to be mobile first, we use a handful of <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries" target="_blank">media queries</a> to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.</p>

<p>Bootstrap primarily uses the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components.</p>

<pre class="mdl-code">
// Extra small devices (portrait phones, less than 576px)
// No media query since this is the default in Bootstrap

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }

// Extra large devices (large desktops, 1280px and up)
@media (min-width: 1280px) { ... }
</pre>

<p>Since we write our source CSS in Sass, all our media queries are available via Sass function:</p>

<pre class="mdl-code">
.some-class {
	@media(min-width: breakpoint-min(md)) {
		display: block;
	}
}
</pre>

<p>We occasionally use media queries that go in the other direction (the given screen size <em>or smaller</em>):</p>

<pre class="mdl-code">
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575px) { ... }

// Small devices (landscape phones, less than 768px)
@media (max-width: 767px) { ... }

// Medium devices (tablets, less than 992px)
@media (max-width: 991px) { ... }

// Large devices (desktops, less than 1200px)
@media (max-width: 1199px) { ... }

// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
</pre>

<p>Once again, these media queries are also available via Sass function:</p>

<pre class="mdl-code">
.some-class {
	@media(min-width: breakpoint-max(md)) {
		...
	}
}
</pre>

<p>There are also media queries in Sass mixins:</p>

<pre class="mdl-code">
@include media-breakpoint-up(xl) { ... }
@include media-breakpoint-down(lg) { ... }
@include media-breakpoint-only(xl) { ... }
@include media-breakpoint-between(md, xl) { ... }
</pre>

<p><strong>Grid</strong></p>

<p>Bootstrap’s grid system uses a series of containers, rows, and columns to layout and align content. It’s built with <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes">flexbox</a> and is fully responsive. Below is an example and an in-depth look at how the grid comes together.</p>

<p><strong>New to or unfamiliar with flexbox?</strong> <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/#flexbox-background">Read this CSS Tricks flexbox guide</a> for background, terminology, guidelines, and code snippets.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row">
				<div class="col-sm">
					<div class="p-1 mdl-highlight">One of three columns</div>
				</div>
				<div class="col-sm">
					<div class="p-1 mdl-highlight">One of three columns</div>
				</div>
				<div class="col-sm">
					<div class="p-1 mdl-highlight">One of three columns</div>
				</div>
			</div>
		</div>
    </div>
    <pre>&lt;div class="container">
	&lt;div class="row">
		&lt;div class="col-sm">
			One of three columns
		&lt;/div>
		&lt;div class="col-sm">
			One of three columns
		&lt;/div>
		&lt;div class="col-sm">
			One of three columns
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p>The above example creates three equal-width columns on small, medium, large, and extra large devices using our predefined grid classes. Those columns are centered in the page with the parent <code>.container</code>.</p>

<p>Breaking it down, here’s how it works:</p>

<ul>
	<li>Containers provide a means to center and horizontally pad your site’s contents. Use <code>.container</code> for a responsive pixel width or <code>.container-fluid</code> for <code>width: 100%</code> across all viewport and device sizes.</li>
	<li>Rows are wrappers for columns. Each column has horizontal <code>padding</code> (called a gutter) for controlling the space between them. This <code>padding</code> is then counteracted on the rows with negative margins. This way, all the content in your columns is visually aligned down the left side.</li>
	<li>In a grid layout, content must be placed within columns and only columns may be immediate children of rows.</li>
	<li>Thanks to flexbox, grid columns without a specified <code>width</code> will automatically layout as equal width columns. For example, four instances of <code>.col-sm</code> will each automatically be 25% wide from the small breakpoint and up. See the auto-layout columns section for more examples.</li>
	<li>Column classes indicate the number of columns you’d like to use out of the possible 12 per row. So, if you want three equal-width columns across, you can use <code>.col-4</code>.</li>
	<li>Column <code>width</code>s are set in percentages, so they’re always fluid and sized relative to their parent element.</li>
	<li>Columns have horizontal <code>padding</code> to create the gutters between individual columns, however, you can remove the <code>margin</code> from rows and <code>padding</code> from columns with <code>.no-gutters</code> on the <code>.row</code>.</li>
	<li>To make the grid responsive, there are five grid breakpoints, one for each responsive breakpoint: all breakpoints (extra small), small, medium, large, and extra large.</li>
	<li>Grid breakpoints are based on minimum width media queries, meaning <strong>they apply to that one breakpoint and all those above it</strong> (e.g., <code>.col-sm-4</code> applies to small, medium, large, and extra large devices, but not the first <code>xs</code> breakpoint).</li>
	<li>You can use predefined grid classes (like <code>.col-4</code>) or Sass mixins for more semantic markup.</li>
</ul>

<p>Be aware of the limitations and <a href="https://github.com/philipwalton/flexbugs">bugs around flexbox</a>, like the <a href="https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers">inability to use some HTML elements as flex containers</a>.</p>

<p><strong>Grid options</strong></p>

<p>While Bootstrap uses <code>em</code>s or <code>rem</code>s for defining most sizes, <code>px</code>s are used for grid breakpoints and container widths. This is because the viewport width is in pixels and does not change with the <a href="https://drafts.csswg.org/mediaqueries-3/#units">font size</a>.</p>

<p>See how aspects of the Bootstrap grid system work across multiple devices with a handy table.</p>

<table class="table table-bordered table-striped">
	<thead>
		<tr>
		<th></th>
		<th class="text-center">
			Extra small<br>
			<small>&lt;576px</small>
		</th>
		<th class="text-center">
			Small<br>
			<small>≥576px</small>
		</th>
		<th class="text-center">
			Medium<br>
			<small>≥768px</small>
		</th>
		<th class="text-center">
			Large<br>
			<small>≥992px</small>
		</th>
		<th class="text-center">
			Extra large<br>
			<small>≥1200px</small>
		</th>
		</tr>
	</thead>
	<tbody>
		<tr>
		<th class="text-nowrap" scope="row">Max container width</th>
		<td>None (auto)</td>
		<td>540px</td>
		<td>720px</td>
		<td>960px</td>
		<td>1140px</td>
		</tr>
		<tr>
		<th class="text-nowrap" scope="row">Class prefix</th>
		<td><code>.col-</code></td>
		<td><code>.col-sm-</code></td>
		<td><code>.col-md-</code></td>
		<td><code>.col-lg-</code></td>
		<td><code>.col-xl-</code></td>
		</tr>
		<tr>
		<th class="text-nowrap" scope="row"># of columns</th>
		<td colspan="5">12</td>
		</tr>
		<tr>
		<th class="text-nowrap" scope="row">Gutter width</th>
		<td colspan="5">30px (15px on each side of a column)</td>
		</tr>
		<tr>
		<th class="text-nowrap" scope="row">Nestable</th>
		<td colspan="5">Yes</td>
		</tr>
		<tr>
		<th class="text-nowrap" scope="row">Column ordering</th>
		<td colspan="5">Yes</td>
		</tr>
	</tbody>
</table>

<p><strong>Auto-layout columns</strong></p>

<p>Utilize breakpoint-specific column classes for easy column sizing without an explicit numbered class like <code>.col-sm-6</code>.</p>

<p>Equal-width</p>

<p>For example, here are two grid layouts that apply to every device and viewport, from <code>xs</code> to <code>xl</code>. Add any number of unit-less classes for each breakpoint you need and every column will be the same width.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row">
                <div class="col">
                    <div class="p-1 mdl-highlight">1 of 2</div>
                </div>
                <div class="col">
                    <div class="p-1 mdl-highlight">2 of 2</div>
                </div>
                </div>
                <div class="row">
                <div class="col">
                    <div class="p-1 mdl-highlight">1 of 3</div>
                </div>
                <div class="col">
                    <div class="p-1 mdl-highlight">2 of 3</div>
                </div>
                <div class="col">
                    <div class="p-1 mdl-highlight">3 of 3</div>
                </div>
			</div>
		</div>
	</div>
	<pre>&lt;div class="container">
	&lt;div class="row">
		&lt;div class="col">
			1 of 2
		&lt;/div>
		&lt;div class="col">
			2 of 2
		&lt;/div>
	&lt;/div>
	&lt;div class="row">
		&lt;div class="col">
			1 of 3
		&lt;/div>
		&lt;div class="col">
			2 of 3
		&lt;/div>
		&lt;div class="col">
			3 of 3
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p>Equal-width columns can be broken into multiple lines, but there was a <a href="https://github.com/philipwalton/flexbugs#11-min-and-max-size-declarations-are-ignored-when-wrapping-flex-items">Safari flexbox bug</a> that prevented this from working without an explicit <code>flex-basis</code> or <code>border</code>. There are workarounds for older browser versions, but they shouldn’t be necessary if you’re up-to-date.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row">
				<div class="col">
					<div class="p-1 mdl-highlight">Column</div>
				</div>
				<div class="col">
					<div class="p-1 mdl-highlight">Column</div>
				</div>
				<div class="w-100">

				</div>
				<div class="col">
					<div class="p-1 mdl-highlight">Column</div>
				</div>
				<div class="col">
					<div class="p-1 mdl-highlight">Column</div>
				</div>
			</div>
		</div>
	</div>
<pre>&lt;div class="container">
	&lt;div class="row">
		&lt;div class="col">Column&lt;/div>
		&lt;div class="col">Column&lt;/div>
		&lt;div class="w-100">&lt;/div>
		&lt;div class="col">Column&lt;/div>
		&lt;div class="col">Column&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Setting one column width</strong></p>

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

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row">
				<div class="col">
                    <div class="p-1 mdl-highlight">1 of 3</div>
				</div>
				<div class="col-12">
                    <div class="p-1 mdl-highlight">2 of 3 (wider)</div>
				</div>
				<div class="col">
                    <div class="p-1 mdl-highlight">3 of 3</div>
				</div>
			</div>
			<div class="row">
				<div class="col">
                    <div class="p-1 mdl-highlight">1 of 3</div>
				</div>
				<div class="col-10">
                    <div class="p-1 mdl-highlight">2 of 3 (wider)</div>
				</div>
				<div class="col">
                    <div class="p-1 mdl-highlight">3 of 3</div>
				</div>
			</div>
		</div>
	</div>
<pre>&lt;div class="container">
	&lt;div class="row">
		&lt;div class="col">
			1 of 3
		&lt;/div>
		&lt;div class="col-12">
			2 of 3 (wider)
		&lt;/div>
		&lt;div class="col">
			3 of 3
		&lt;/div>
	&lt;/div>
	&lt;div class="row">
		&lt;div class="col">
			1 of 3
		&lt;/div>
		&lt;div class="col-10">
			2 of 3 (wider)
		&lt;/div>
		&lt;div class="col">
			3 of 3
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Variable width content</strong></p>

<p n:syntax="off">Use <code>col-{breakpoint}-auto</code> classes to size columns based on the natural width of their content.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row justify-content-md-center">
				<div class="col col-lg-4">
                    <div class="p-1 mdl-highlight">1 of 3</div>
				</div>
				<div class="col-md-auto">
                    <div class="p-1 mdl-highlight">Variable width content</div>
				</div>
				<div class="col col-lg-4">
                    <div class="p-1 mdl-highlight">3 of 3</div>
				</div>
			</div>
			<div class="row">
				<div class="col">
                    <div class="p-1 mdl-highlight">1 of 3</div>
				</div>
				<div class="col-md-auto">
                    <div class="p-1 mdl-highlight">Variable width content</div>
				</div>
				<div class="col col-lg-4">
                    <div class="p-1 mdl-highlight">3 of 3</div>
				</div>
			</div>
		</div>
	</div>
<pre>&lt;div class="container">
	&lt;div class="row justify-content-md-center">
		&lt;div class="col col-lg-2">
			1 of 3
		&lt;/div>
		&lt;div class="col-md-auto">
			Variable width content
		&lt;/div>
		&lt;div class="col col-lg-2">
			3 of 3
		&lt;/div>
	&lt;/div>
	&lt;div class="row">
		&lt;div class="col">
			1 of 3
		&lt;/div>
		&lt;div class="col-md-auto">
			Variable width content
		&lt;/div>
		&lt;div class="col col-lg-2">
			3 of 3
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Equal-width multi-row</strong></p>

<p>Create equal-width columns that span multiple rows by inserting a <code>.w-100</code> where you want the columns to break to a new line. Make the breaks responsive by mixing the <code>.w-100</code> with some responsive display utilities.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
			<div class="w-100"></div>
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col">.col&lt;/div>
	&lt;div class="col">.col&lt;/div>
	&lt;div class="w-100">&lt;/div>
	&lt;div class="col">.col&lt;/div>
	&lt;div class="col">.col&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Responsive classes</strong></p>

<p>Bootstrap’s grid includes five tiers of predefined classes for building complex responsive layouts. Customize the size of your columns on extra small, small, medium, large, or extra large devices however you see fit.</p>

<p><strong>All breakpoints</strong></p>

<p>For grids that are the same from the smallest of devices to the largest, use the <code>.col</code> and <code>.col-*</code> classes. Specify a numbered class when you need a particularly sized column; otherwise, feel free to stick to <code>.col</code>.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
            <div class="col"><div class="p-1 mdl-highlight">.col</div></div>
		</div>
		<div class="row">
            <div class="col-16"><div class="p-1 mdl-highlight">.col-16</div></div>
            <div class="col-8"><div class="p-1 mdl-highlight">.col-8</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col">.col&lt;/div>
	&lt;div class="col">.col&lt;/div>
	&lt;div class="col">.col&lt;/div>
	&lt;div class="col">.col&lt;/div>
&lt;/div>
&lt;div class="row">
	&lt;div class="col-16">.col-16&lt;/div>
	&lt;div class="col-8">.col-8&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Stacked to horizontal</strong></p>

<p>Using a single set of <code>.col-sm-*</code> classes, you can create a basic grid system that starts out stacked before becoming horizontal with at the small breakpoint (<code>sm</code>).</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-sm-16"><div class="p-1 mdl-highlight">.col-sm-16</div></div>
            <div class="col-sm-8"><div class="p-1 mdl-highlight">.col-sm-8</div></div>
		</div>
		<div class="row">
            <div class="col-sm"><div class="p-1 mdl-highlight">.col-sm</div></div>
            <div class="col-sm"><div class="p-1 mdl-highlight">.col-sm</div></div>
            <div class="col-sm"><div class="p-1 mdl-highlight">.col-sm</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
		&lt;div class="col-sm-8">.col-sm-16&lt;/div>
		&lt;div class="col-sm-4">.col-sm-8&lt;/div>
	&lt;/div>
	&lt;div class="row">
		&lt;div class="col-sm">.col-sm&lt;/div>
		&lt;div class="col-sm">.col-sm&lt;/div>
		&lt;div class="col-sm">.col-sm&lt;/div>
	&lt;/div></pre>
</div>

<p><strong>Mix and match</strong></p>

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

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-24 col-md-16"><div class="p-1 mdl-highlight">.col-24 .col-md-16</div></div>
            <div class="col-12 col-md-8"><div class="p-1 mdl-highlight">.col-12 .col-md-8</div></div>
		</div>
		<div class="row">
            <div class="col-12 col-md-8"><div class="p-1 mdl-highlight">.col-12 .col-md-8</div></div>
            <div class="col-12 col-md-8"><div class="p-1 mdl-highlight">.col-12 .col-md-8</div></div>
            <div class="col-12 col-md-8"><div class="p-1 mdl-highlight">.col-12 .col-md-8</div></div>
		</div>
		<div class="row">
            <div class="col-12"><div class="p-1 mdl-highlight">.col-12</div></div>
            <div class="col-12"><div class="p-1 mdl-highlight">.col-12</div></div>
		</div>
	</div>
    <pre>&lt;!-- Stack the columns on mobile by making one full-width and the other half-width -->
&lt;div class="row">
	&lt;div class="col-24 col-md-16">.col-12 .col-md-16&lt;/div>
	&lt;div class="col-12 col-md-8">.col-12 .col-md-8&lt;/div>
&lt;/div>
&lt;!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
&lt;div class="row">
	&lt;div class="col-12 col-md-8">.col-12 .col-md-8&lt;/div>
	&lt;div class="col-12 col-md-8">.col-12 .col-md-8&lt;/div>
	&lt;div class="col-12 col-md-8">.col-12 .col-md-8&lt;/div>
&lt;/div>
&lt;!-- Columns are always 50% wide, on mobile and desktop -->
&lt;div class="row">
	&lt;div class="col-12">.col-12&lt;/div>
	&lt;div class="col-12">.col-12&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Alignment</strong></p>

<p>Use flexbox alignment utilities to vertically and horizontally align columns.</p>

<p><strong>Vertical alignment</strong></p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row noalign-items-start no-gutters mdl-highlight" style="height: 200px">
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
			</div>
			<div class="row align-items-center no-gutters mdl-highlight" style="height: 200px">
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
			</div>
			<div class="row align-items-end no-gutters mdl-highlight" style="height: 200px">
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
                <div class="col m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
                </div>
			</div>
		</div>
	</div>
    <pre>&lt;div class="container">
	&lt;div class="row align-items-start">
		&lt;div class="col">
			One of three columns
		&lt;/div>
		&lt;div class="col">
			One of three columns
		&lt;/div>
		&lt;div class="col">
			One of three columns
		&lt;/div>
	&lt;/div>
	&lt;div class="row align-items-center">
		&lt;div class="col">
			One of three columns
		&lt;/div>
		&lt;div class="col">
			One of three columns
		&lt;/div>
		&lt;div class="col">
			One of three columns
		&lt;/div>
	&lt;/div>
	&lt;div class="row align-items-end">
		&lt;div class="col">
			One of three columns
		&lt;/div>
		&lt;div class="col">
			One of three columns
		&lt;/div>
		&lt;div class="col">
			One of three columns
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p></p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row no-gutters mdl-highlight" style="height: 150px">
				<div class="col align-self-start m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
				</div>
				<div class="col align-self-center m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
				</div>
				<div class="col align-self-end m-0">
                    <div class="p-1 mdl-highlight">One of three columns</div>
				</div>
			</div>
		</div>
	</div>
    <pre>&lt;div class="container">
	&lt;div class="row">
		&lt;div class="col align-self-start">
			One of three columns
		&lt;/div>
		&lt;div class="col align-self-center">
			One of three columns
		&lt;/div>
		&lt;div class="col align-self-end">
			One of three columns
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Horizontal alignment</strong></p>

<div class="mdl-example">
    <div class="container">
        <div class="row justify-content-start">
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
        </div>
        <div class="row justify-content-center">
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
        </div>
        <div class="row justify-content-end">
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
        </div>
        <div class="row justify-content-around">
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
        </div>
        <div class="row justify-content-between">
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
            <div class="col-8">
                <div class="p-1 mdl-highlight">One of two columns</div>
            </div>
        </div>
    </div>
    <pre>&lt;div class="container">
	&lt;div class="row justify-content-start">
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
	&lt;/div>
	&lt;div class="row justify-content-center">
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
	&lt;/div>
	&lt;div class="row justify-content-end">
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
	&lt;/div>
	&lt;div class="row justify-content-around">
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
	&lt;/div>
	&lt;div class="row justify-content-between">
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
		&lt;div class="col-8">
		 One of two columns
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>No gutters</strong></p>

<p>The gutters between columns in our predefined grid classes can be removed with <code>.no-gutters</code>. This removes the negative <code>margins</code> from <code>.row</code> and the horizontal <code>padding</code> from all immediate children columns.</p>

<p>Here’s the source code for creating these styles. Note that column overrides are scoped to only the first children columns and are targeted via <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors">attribute selector</a>. While this generates a more specific selector, column padding can still be further customized with spacing utilities.</p>

<p><strong>Need an edge-to-edge design?</strong> Drop the parent <code>.container</code> or <code>.container-fluid</code>.</p>

<pre class="mdl-code">
.no-gutters {
	margin-right: 0;
	margin-left: 0;
	
	> .col,
	> [class*="col-"] {
		padding-right: 0;
		padding-left: 0;
	}
	}
</pre>

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

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row no-gutters">
			<div class="col-24 col-sm-12 col-md-16">
                <div class="p-1 mdl-highlight">.col-24 .col-sm-12 .col-md-16</div>
            </div>
			<div class="col-12 col-md-8">
                <div class="p-1 mdl-highlight">.col-12 .col-md-8</div>
            </div>
		</div>
	</div>
    <pre>&lt;div class="row no-gutters">
	&lt;div class="col-24 col-sm-12 col-md-16">.col-24 .col-sm-12 .col-md-16&lt;/div>
	&lt;div class="col-12 col-md-8">.col-12 .col-md-8&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Line gutters</strong></p>

<p>Line gutters has the same usege as no-gutters, so class is added to row. This removes default gutter spacing from all immediate children columns and <strong>add</strong> 1px margin-top and 1px padding-left.</p>

<pre class="mdl-code">
.line-gutters {
	margin: -1px 0 0 -1px;

	& > .col,
	& > [class*="col-"] {
		margin-bottom: 0;
		margin-top: 1px;
		padding-left: 1px;
		padding-right: 0;
	}
}
</pre>

<p></p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row line-gutters">
			<div class="col-24 col-sm-12 col-md-6">
                <div class="p-1 mdl-highlight">.col-24 .col-sm-12 .col-md-6</div>
            </div>
			<div class="col-24 col-sm-12 col-md-6">
                <div class="p-1 mdl-highlight">.col-24 .col-sm-12 .col-md-6</div>
            </div>
            <div class="col-12 col-md-6">
                <div class="p-1 mdl-highlight">.col-12 .col-md-6</div>
            </div>
            <div class="col-12 col-md-6">
                <div class="p-1 mdl-highlight">.col-12 .col-md-6</div>
            </div>
		</div>
	</div>
    <pre>&lt;div class="row line-gutters">
    &lt;div class="col-24 col-sm-12 col-md-6">.col-24 .col-sm-12 .col-md-6&lt;/div>
    &lt;div class="col-24 col-sm-12 col-md-6">.col-24 .col-sm-12 .col-md-6&lt;/div>
    &lt;div class="col-12 col-md-6">.col-12 .col-md-6&lt;/div>
    &lt;div class="col-12 col-md-6">.col-12 .col-md-6&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Column wrapping</strong></p>

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

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-18"><div class="p-1 mdl-highlight">.col-18</div></div>
            <div class="col-8"><div class="p-1 mdl-highlight">.col-8<br>Since 18 + 8 = 26 &gt; 24, this 8-column-wide div gets wrapped onto a new line as one contiguous unit.</div></div>
            <div class="col-12"><div class="p-1 mdl-highlight">.col-12<br>Subsequent columns continue along the new line.</div></div>
		</div>
	</div>
    <pre>
&lt;div class="row">
	&lt;div class="col-18">.col-18&lt;/div>
	&lt;div class="col-8">.col-8&lt;br>Since 18 + 8 = 26 &gt; 24, this 8-column-wide div gets wrapped onto a new line as one contiguous unit.&lt;/div>
	&lt;div class="col-12">.col-12&lt;br>Subsequent columns continue along the new line.&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Column breaks</strong></p>

<p>Breaking columns to a new line in flexbox requires a small hack: add an element with <code>width: 100%</code> wherever you want to wrap your columns to a new line. Normally this is accomplished with multiple <code>.rows</code>, but not every implementation method can account for this.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-12 col-sm-9"><div class="p-1 mdl-highlight">.col-12 .col-sm-6</div></div>
            <div class="col-12 col-sm-9"><div class="p-1 mdl-highlight">.col-12 .col-sm-6</div></div>
			<div class="w-100"></div>
            <div class="col-12 col-sm-6"><div class="p-1 mdl-highlight">.col-12 .col-sm-6</div></div>
            <div class="col-12 col-sm-6"><div class="p-1 mdl-highlight">.col-12 .col-sm-6</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col-12 col-sm-6">.col-12 .col-sm-6&lt;/div>
	&lt;div class="col-12 col-sm-6">.col-12 .col-sm-6&lt;/div>

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

	&lt;div class="col-12 col-sm-6">.col-12 .col-sm-6&lt;/div>
	&lt;div class="col-12 col-sm-6">.col-12 .col-sm-6&lt;/div>
&lt;/div></pre>
</div>

<p>You may also apply this break at specific breakpoints with our responsive display utilities.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-12 col-sm-8"><div class="p-1 mdl-highlight">.col-12 .col-sm-8</div></div>
            <div class="col-12 col-sm-8"><div class="p-1 mdl-highlight">.col-12 .col-sm-8</div></div>
			<div class="w-100 d-none d-md-block"></div>
            <div class="col-12 col-sm-8"><div class="p-1 mdl-highlight">.col-12 .col-sm-8</div></div>
            <div class="col-12 col-sm-8"><div class="p-1 mdl-highlight">.col-12 .col-sm-8</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col-12 col-sm-8">.col-12 .col-sm-8&lt;/div>
	&lt;div class="col-12 col-sm-8">.col-12 .col-sm-8&lt;/div>
	
	&lt;!-- Force next columns to break to new line at md breakpoint and up -->
	&lt;div class="w-100 d-none d-md-block">&lt;/div>
	
	&lt;div class="col-12 col-sm-8">.col-12 .col-sm-8&lt;/div>
	&lt;div class="col-12 col-sm-8">.col-12 .col-sm-8&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Reordering</strong></p>

<p><strong>Reordering Order classes</strong></p>

<p>Use <code>.order-</code> classes for controlling the <strong>visual order</strong> of your content. These classes are responsive, so you can set the <code>order</code> by breakpoint (e.g., <code>.order-1.order-md-2</code>). Includes support for <code>1</code> through <code>24</code> across all five grid tiers.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="container">
			<div class="row">
                <div class="col">
                    <div class="p-1 mdl-highlight">First, but unordered</div>
                </div>
                <div class="col order-12">
                    <div class="p-1 mdl-highlight">Second, but last</div>
                </div>
                <div class="col order-1">
                    <div class="p-1 mdl-highlight">Third, but first</div>
                </div>
			</div>
		</div>
	</div>
    <pre>&lt;div class="container">
	&lt;div class="row">
		&lt;div class="col">
			First, but unordered
		&lt;/div>
		&lt;div class="col order-12">
			Second, but last
		&lt;/div>
		&lt;div class="col order-1">
			Third, but first
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p>There are also responsive <code>.order-first</code> and <code>.order-last</code> classes that change the <code>order</code> of an element by applying <code>order: -1</code> and <code>order: 13 (order: $columns + 1)</code>, respectively. These classes can also be intermixed with the numbered <code>.order-*</code> classes as needed.</p>

<p><strong>Offsetting columns</strong></p>

<p>You can offset grid columns in two ways: our responsive <code>.offset-</code> 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.</p>

<p><strong>Offset classes</strong></p>

<p>Move columns to the right using <code>.offset-md-*</code> classes. These classes increase the left margin of a column by <code>*</code> columns. For example, <code>.offset-md-8</code> moves <code>.col-md-8</code> over four columns.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-md-8"><div class="p-1 mdl-highlight">.col-md-8</div></div>
            <div class="col-md-8 offset-md-8"><div class="p-1 mdl-highlight">.col-md-16 .offset-md-16</div></div>
		</div>
		<div class="row">
            <div class="col-md-6 offset-md-6"><div class="p-1 mdl-highlight">.col-md-6 .offset-md-6</div></div>
            <div class="col-md-6 offset-md-6"><div class="p-1 mdl-highlight">.col-md-6 .offset-md-6</div></div>
		</div>
		<div class="row">
            <div class="col-md-12 offset-md-6"><div class="p-1 mdl-highlight">.col-md-12 .offset-md-6</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col-md-8">.col-md-8&lt;/div>
	&lt;div class="col-md-8 offset-md-8">.col-md-8 .offset-md-8&lt;/div>
&lt;/div>
&lt;div class="row">
	&lt;div class="col-md-6 offset-md-6">.col-md-6 .offset-md-6&lt;/div>
	&lt;div class="col-md-6 offset-md-6">.col-md-6 .offset-md-6&lt;/div>
&lt;/div>
&lt;div class="row">
	&lt;div class="col-md-12 offset-md-6">.col-md-12 .offset-md-6&lt;/div>
&lt;/div></pre>
</div>

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

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-sm-10 col-md-12"><div class="p-1 mdl-highlight">.col-sm-10 .col-md-12</div></div>
            <div class="col-sm-10 offset-sm-4 col-md-12 offset-md-0"><div class="p-1 mdl-highlight">.col-sm-10 .offset-sm-4 .col-md-12 .offset-md-0</div></div>
		</div>
		<div class="row">
            <div class="col-sm-12 col-md-10 col-lg-12"><div class="p-1 mdl-highlight">.col-sm-12 .col-md-10 .col-lg-12</div></div>
            <div class="col-sm-12 col-md-10 offset-md-4 col-lg-12 offset-lg-0"><div class="p-1 mdl-highlight">.col-sm-12 .col-md-10 .offset-md-4 .col-lg-12 .offset-lg-0</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
  &lt;div class="col-sm-10 col-md-12">.col-sm-10 .col-md-12&lt;/div>
  &lt;div class="col-sm-10 offset-sm-4 col-md-12 offset-md-0">.col-sm-10 .offset-sm-4 .col-md-12 .offset-md-0&lt;/div>
&lt;/div>
	
&lt;div class="row">
  &lt;div class="col-sm-12 col-md-10 col-lg-12">.col-sm-12 .col-md-10 .col-lg-12&lt;/div>
  &lt;div class="col-sm-12 col-md-10 offset-md-4 col-lg-12 offset-lg-0">.col-sm-12 .col-md-10 .offset-md-4 .col-lg-12 .offset-lg-0&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Margin utilities</strong></p>

<p>With the move to flexbox in v4, you can use margin utilities like <code>.mr-auto</code> to force sibling columns away from one another.</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
            <div class="col-md-8"><div class="p-1 mdl-highlight">.col-md-8</div></div>
            <div class="col-md-8 ml-auto"><div class="p-1 mdl-highlight">.col-md-8 .ml-auto</div></div>
		</div>
		<div class="row">
            <div class="col-md-6 ml-md-auto"><div class="p-1 mdl-highlight">.col-md-6 .ml-md-auto</div></div>
            <div class="col-md-6 ml-md-auto"><div class="p-1 mdl-highlight">.col-md-6 .ml-md-auto</div></div>
		</div>
		<div class="row">
            <div class="col-auto mr-auto"><div class="p-1 mdl-highlight">.col-auto .mr-auto</div></div>
            <div class="col-auto"><div class="p-1 mdl-highlight">.col-auto</div></div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col-md-8">.col-md-8&lt;/div>
	&lt;div class="col-md-8 ml-auto">.col-md-8 .ml-auto&lt;/div>
&lt;/div>
&lt;div class="row">
	&lt;div class="col-md-6 ml-md-auto">.col-md-6 .ml-md-auto&lt;/div>
	&lt;div class="col-md-6 ml-md-auto">.col-md-6 .ml-md-auto&lt;/div>
&lt;/div>
&lt;div class="row">
	&lt;div class="col-auto mr-auto">.col-auto .mr-auto&lt;/div>
	&lt;div class="col-auto">.col-auto&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Nesting</strong></p>

<p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-sm-*</code> columns within an existing <code>.col-sm-*</code> 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).</p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="row">
			<div class="col-sm-18">
                <div class="p-1 mdl-highlight">
                    Level 1: .col-sm-18
                    <div class="row">
                        <div class="col-16 col-sm-12">
                            <div class="p-1 mdl-highlight">Level 2: .col-16 .col-sm-12</div>
                        </div>
                        <div class="col-8 col-sm-12">
                            <div class="p-1 mdl-highlight">Level 2: .col-8 .col-sm-12</div>
                        </div>
                    </div>
                </div>
			</div>
		</div>
	</div>
    <pre>&lt;div class="row">
	&lt;div class="col-sm-18">
		Level 1: .col-sm-18
		&lt;div class="row">
		&lt;div class="col-16 col-sm-12">
			Level 2: .col-16 .col-sm-12
		&lt;/div>
		&lt;div class="col-8 col-sm-12">
			Level 2: .col-8 .col-sm-12
		&lt;/div>
		&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Sass mixins</strong></p>

<p>When using Bootstrap’s source Sass files, you have the option of using Sass variables and mixins to create custom, semantic, and responsive page layouts. Our predefined grid classes use these same variables and mixins to provide a whole suite of ready-to-use classes for fast responsive layouts.</p>

<p><strong>Variables</strong></p>

<p>Variables and maps determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.</p>

<pre class="mdl-code">
$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
);
</pre>

<p><strong>Mixins</strong></p>

<p>Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.</p>

<pre class="mdl-code">
// 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);
</pre>

<p><strong>Example usage</strong></p>

<p>You can modify the variables to your own custom values, or just use the mixins with their default values. Here’s an example of using the default settings to create a two-column layout with a gap between.</p>

<pre class="mdl-code">
.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);
	}
}
</pre>

<p></p>

<div class="mdl-example">
	<div class="mdl-example-inner">
		<div class="example-container">
			<div class="example-row" style="display: flex;">
			<div class="example-content-main" style="flex: 0 0 66.666667%;max-width: 66.666667%;">Main content</div>
			<div class="example-content-secondary" style="flex: 0 0 33.333333%; max-width: 33.333333%;">Secondary content</div>
			</div>
		</div>
	</div>
    <pre>
&lt;div class="example-container">
	&lt;div class="example-row">
		&lt;div class="example-content-main">Main content&lt;/div>
		&lt;div class="example-content-secondary">Secondary content&lt;/div>
	&lt;/div>
&lt;/div></pre>
</div>

<p><strong>Customizing the grid</strong></p>

<p>Using our built-in grid Sass variables and maps, it’s possible to completely customize the predefined grid classes. Change the number of tiers, the media query dimensions, and the container widths—then recompile.</p>

<p><strong>Columns and gutters</strong></p>

<p>The number of grid columns can be modified via Sass variables. <code>$grid-columns</code> is used to generate the widths (in percent) of each individual column while <code>$grid-gutter-width</code> allows breakpoint-specific widths that are divided evenly across <code>padding-left</code> and <code>padding-right</code> for the column gutters.</p>

<pre>
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
</pre>

<p><strong>Grid tiers</strong></p>

<p>Moving beyond the columns themselves, you may also customize the number of grid tiers. If you wanted just four grid tiers, you’d update the <code>$grid-breakpoints</code> and <code>$container-max-widths</code> to something like this:</p>

<pre class="mdl-code">
$grid-breakpoints: (
	xs: 0,
	sm: 480px,
	md: 768px,
	lg: 1024px
);
	
$container-max-widths: (
	sm: 420px,
	md: 720px,
	lg: 960px
);
</pre>

<p>When making any changes to the Sass variables or maps, you’ll need to save your changes and recompile. Doing so will output a brand new set of predefined grid classes for column widths, offsets, and ordering. Responsive visibility utilities will also be updated to use the custom breakpoints. Make sure to set grid values in <code>px</code>  (not <code> rem</code>, <code>em</code>, or <code>%</code>).</p>
/*!
 * Bootstrap Grid v4.0.0-beta.3 (https://getbootstrap.com)
 * Copyright 2011-2017 The Bootstrap Authors
 * Copyright 2011-2017 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

@import "vars";
@import "~bootstrap/scss/mixins/grid-framework";
@import "~bootstrap/scss/mixins/grid";
@import "~bootstrap/scss/grid";
@import "~bootstrap/scss/utilities/flex";

@at-root {
    // sass-lint:disable no-vendor-prefixes
    @-ms-viewport {
        width: device-width;
    }
    // sass-lint:enable no-vendor-prefixes
}

html,
body {

    height: 100%;

    &.no-scroll {

        overflow: hidden;

    }
    
}

html {

    -ms-overflow-style: scrollbar; // sass-lint:disable-line no-vendor-prefixes
    box-sizing: border-box;
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-behavior: smooth;

    &.wf-loading {

        * {

            color: transparent !important; // sass-lint:disable-line no-important

        }

    }

    &:before {

        $length: length($grid-breakpoints);
        $keys: map-keys($grid-breakpoints);

        @if $length > 1 {
            $breakpoints-content: '{"';

            @each $name, $value in $grid-breakpoints {
                $next: breakpoint-next($name, $grid-breakpoints);
                $value: breakpoint-min($name);

                @if $value {
                    $breakpoints-content: str-insert($breakpoints-content, $name + '" : "(min-width: ' + $value + ')', -1);
                }

                @if $next {
                    $sep: if($value, ' and ', $name + '" : "');
                    $breakpoints-content: str-insert($breakpoints-content, $sep + '(max-width: ' + (breakpoint-min($next) - .001em) + ')", "', -1);
                } @else {
                    $breakpoints-content: str-insert($breakpoints-content, '"', -1);
                }
            }

            @if variable-exists(menu-breakpoint) {
                $breakpoints-content: str-insert($breakpoints-content, ', "menu" : "(min-width: ' + breakpoint-min($menu-breakpoint) + ')"', -1);
            }

            $breakpoints-content: str-insert($breakpoints-content, '}', -1);

            content: $breakpoints-content;
            display: none;

        }

    }

}

body {

    display: flex; // Setup to sticky footer
    flex-direction: column;
    height: 100vh;

    &.js-focus-visible {

        :focus {

            &:not(.focus-visible) {

                outline: none;

            }

        }

    }

}

*,
*:before,
*:after {

    box-sizing: inherit;

}

img {

    height: auto;
    max-width: 100%;

}

.container {

    &-1240 {

        max-width: map-get($container-max-widths, 'xl');

    }

    &-960 {

        max-width: map-get($container-max-widths, 'lg');

    }

    &-770 {

        max-width: map-get($container-max-widths, 'md');

    }

}

.row {

    margin-bottom: -($grid-gutter-width / 2);
    margin-top: -($grid-gutter-width / 2);

    > .col,
    > [class*="col-"] {

        margin-bottom: ($grid-gutter-width / 2);
        margin-top: ($grid-gutter-width / 2);

    }

    &.no-gutters {

        margin-bottom: 0;
        margin-top: 0;

        > .col,
        > [class*="col-"] {

            margin-bottom: 0;
            margin-top: 0;

        }

    }

    &.line-gutters {

        margin: -1px 0 0 -1px;

        > .col,
        > [class*="col-"] {

            margin-bottom: 0;
            margin-top: 1px;
            padding-left: 1px;
            padding-right: 0;

        }

    }

}
.bg-first
.bg-second
.bg-red
.bg-green
.bg-orange
.bg-black
.bg-gray-dark-extra
.bg-gray-dark
.bg-gray
.bg-gray-light
.bg-white
<div class="m-buttons">
	<?php foreach ($colors as $color) { ?>
		<div class="bg-<?php echo $color; ?>">.bg-<?php echo $color; ?></div>
	<?php } ?>
</div>
@each $name, $value in $colors {

    @if type-of($value) == 'map' {

        $value: map-get($value, '60');

    }

    .text-#{$name} {

        color: $value;

    }

    .bg-#{$name} {

        background-color: $value;

    }

}

Common display values

The display property accepts a handful of values and we support many of them with utility classes. We purposefully don’t provide every value as a utility, so here’s what we support:

  • .d-none
  • .d-inline
  • .d-inline-block
  • .d-block
  • .d-table
  • .d-table-cell
  • .d-flex
  • .d-inline-flex

Put them to use by applying any of the classes to an element of your choice. For example, here’s how you could use the inline, block, or inline-block utilities (the same applies to the other classes).

d-inline
d-inline
<div class="d-inline bg-green">d-inline</div>
<div class="d-inline bg-green">d-inline</div>

d-block
<div class="d-block bg-orange">d-block</div>

d-inline-block
d-inline-block
<div class="d-inline-block bg-red">d-inline-block</div>
<div class="d-inline-block bg-red">d-inline-block</div>

Responsive variations also exist for every single utility mentioned above.

  • .d-none
  • .d-inline
  • .d-inline-block
  • .d-block
  • .d-table
  • .d-table-cell
  • .d-flex
  • .d-inline-flex
  • .d-sm-none
  • .d-sm-inline
  • .d-sm-inline-block
  • .d-sm-block
  • .d-sm-table
  • .d-sm-table-cell
  • .d-sm-flex
  • .d-sm-inline-flex
  • .d-md-none
  • .d-md-inline
  • .d-md-inline-block
  • .d-md-block
  • .d-md-table
  • .d-md-table-cell
  • .d-md-flex
  • .d-md-inline-flex
  • .d-lg-none
  • .d-lg-inline
  • .d-lg-inline-block
  • .d-lg-block
  • .d-lg-table
  • .d-lg-table-cell
  • .d-lg-flex
  • .d-lg-inline-flex
  • .d-xl-none
  • .d-xl-inline
  • .d-xl-inline-block
  • .d-xl-block
  • .d-xl-table
  • .d-xl-table-cell
  • .d-xl-flex
  • .d-xl-inline-flex

Hiding Elements

For faster mobile-friendly development, use responsive display classes for showing and hiding elements by device. Avoid creating entirely different versions of the same site, instead hide element responsively for each screen size.

To hide elements simply use the .d-none class or one of the .d-{sm,md,lg,xl}-none classes for any responsive screen variation.

To show an element only on a given interval of screen sizes you can combine one .d-*-none class with a .d-*-* class, for example .d-none.d-md-block.d-xl-none will hide the element for all screen sizes except on medium and large devices.

Screen Size Class
Hidden on all d-none
Hidden only on xs d-none d-sm-block
Hidden only on sm d-sm-none d-md-block
Hidden only on md d-md-none d-lg-block
Hidden only on lg d-lg-none d-xl-block
Hidden only on xl d-xl-none
Visible on all d-block
Visible only on xs d-block d-sm-none
Visible only on sm d-none d-sm-block d-md-none
Visible only on md d-none d-md-block d-lg-none
Visible only on lg d-none d-lg-block d-xl-none
Visible only on xl d-none d-xl-block

Display in print

Change the display value of elements when printing with our print display utilities.

Class Print style
.d-print-block Applies display: block to the element when printing
.d-print-inline Applies display: inline to the element when printing
.d-print-inline-block Applies display: inline-block to the element when printing
.d-print-none Applies display: none to the element when printing
<p><strong>Common display values</strong></p>

<p>The <strong>display property</strong> accepts a handful of values and we support many of them with utility classes. We purposefully don’t provide every value as a utility, so here’s what we support:</p>

<ul>
    <li><code>.d-none</code></li>
    <li><code>.d-inline</code></li>
    <li><code>.d-inline-block</code></li>
    <li><code>.d-block</code></li>
    <li><code>.d-table</code></li>
    <li><code>.d-table-cell</code></li>
    <li><code>.d-flex</code></li>
    <li><code>.d-inline-flex</code></li>
</ul>

<p>Put them to use by applying any of the classes to an element of your choice. For example, here’s how you could use the inline, block, or inline-block utilities (the same applies to the other classes).</p>

<div class="mdl-example">
	<div class="container">
        <div class="d-inline bg-green">d-inline</div>
        <div class="d-inline bg-green">d-inline</div>
	</div>
<pre>
&lt;div class="d-inline bg-green">d-inline&lt;/div>
&lt;div class="d-inline bg-green">d-inline&lt;/div>
</pre>
</div>

<p></p>

<div class="mdl-example">
    <div class="container">
        <div class="d-block bg-orange">d-block</div>
    </div>
<pre>
&lt;div class="d-block bg-orange">d-block&lt;/div>
</pre>
</div>

<p></p>

<div class="mdl-example">
    <div class="container">
        <div class="d-inline-block bg-red">d-inline-block</div>
        <div class="d-inline-block bg-red">d-inline-block</div>
    </div>
<pre>
&lt;div class="d-inline-block bg-red">d-inline-block&lt;/div>
&lt;div class="d-inline-block bg-red">d-inline-block&lt;/div>
</pre>
</div>

<p>Responsive variations also exist for every single utility mentioned above.</p>

<ul>
    <li><code>.d-none</code></li>
    <li><code>.d-inline</code></li>
    <li><code>.d-inline-block</code></li>
    <li><code>.d-block</code></li>
    <li><code>.d-table</code></li>
    <li><code>.d-table-cell</code></li>
    <li><code>.d-flex</code></li>
    <li><code>.d-inline-flex</code></li>
    <li><code>.d-sm-none</code></li>
    <li><code>.d-sm-inline</code></li>
    <li><code>.d-sm-inline-block</code></li>
    <li><code>.d-sm-block</code></li>
    <li><code>.d-sm-table</code></li>
    <li><code>.d-sm-table-cell</code></li>
    <li><code>.d-sm-flex</code></li>
    <li><code>.d-sm-inline-flex</code></li>
    <li><code>.d-md-none</code></li>
    <li><code>.d-md-inline</code></li>
    <li><code>.d-md-inline-block</code></li>
    <li><code>.d-md-block</code></li>
    <li><code>.d-md-table</code></li>
    <li><code>.d-md-table-cell</code></li>
    <li><code>.d-md-flex</code></li>
    <li><code>.d-md-inline-flex</code></li>
    <li><code>.d-lg-none</code></li>
    <li><code>.d-lg-inline</code></li>
    <li><code>.d-lg-inline-block</code></li>
    <li><code>.d-lg-block</code></li>
    <li><code>.d-lg-table</code></li>
    <li><code>.d-lg-table-cell</code></li>
    <li><code>.d-lg-flex</code></li>
    <li><code>.d-lg-inline-flex</code></li>
    <li><code>.d-xl-none</code></li>
    <li><code>.d-xl-inline</code></li>
    <li><code>.d-xl-inline-block</code></li>
    <li><code>.d-xl-block</code></li>
    <li><code>.d-xl-table</code></li>
    <li><code>.d-xl-table-cell</code></li>
    <li><code>.d-xl-flex</code></li>
    <li><code>.d-xl-inline-flex</code></li>
</ul>

<p><strong>Hiding Elements</strong></p>

<p>For faster mobile-friendly development, use responsive display classes for showing and hiding elements by device. Avoid creating entirely different versions of the same site, instead hide element responsively for each screen size.</p>
<p n:syntax="off">To hide elements simply use the <strong>.d-none</strong> class or one of the <strong>.d-{sm,md,lg,xl}-none</strong> classes for any responsive screen variation.</p>
<p>To show an element only on a given interval of screen sizes you can combine one <strong>.d-*-none</strong> class with a <strong>.d-*-*</strong> class, for example <strong>.d-none.d-md-block.d-xl-none</strong> will hide the element for all screen sizes except on medium and large devices.</p>

<table>
    <thead>
        <tr>
        <th>Screen Size</th>
        <th>Class</th>
        </tr>
    </thead>
    <tbody>
        <tr>
        <td>Hidden on all</td>
        <td><code>d-none</code></td>
        </tr>
        <tr>
        <td>Hidden only on xs</td>
        <td><code>d-none d-sm-block</code></td>
        </tr>
        <tr>
        <td>Hidden only on sm</td>
        <td><code>d-sm-none d-md-block</code></td>
        </tr>
        <tr>
        <td>Hidden only on md</td>
        <td><code>d-md-none d-lg-block</code></td>
        </tr>
        <tr>
        <td>Hidden only on lg</td>
        <td><code>d-lg-none d-xl-block</code></td>
        </tr>
        <tr>
        <td>Hidden only on xl</td>
        <td><code>d-xl-none</code></td>
        </tr>
        <tr>
        <td>Visible on all</td>
        <td><code>d-block</code></td>
        </tr>
        <tr>
        <td>Visible only on xs</td>
        <td><code>d-block d-sm-none</code></td>
        </tr>
        <tr>
        <td>Visible only on sm</td>
        <td><code>d-none d-sm-block d-md-none</code></td>
        </tr>
        <tr>
        <td>Visible only on md</td>
        <td><code>d-none d-md-block d-lg-none</code></td>
        </tr>
        <tr>
        <td>Visible only on lg</td>
        <td><code>d-none d-lg-block d-xl-none</code></td>
        </tr>
        <tr>
        <td>Visible only on xl</td>
        <td><code>d-none d-xl-block</code></td>
        </tr>
    </tbody>
</table>

<p><strong>Display in print</strong></p>

<p>Change the <strong>display</strong> value of elements when printing with our print display utilities.</p>

<table>
    <thead>
        <tr>
        <th>Class</th>
        <th>Print style</th>
        </tr>
    </thead>
    <tbody>
        <tr>
        <td><code>.d-print-block</code></td>
        <td>Applies <code>display: block</code> to the element when printing</td>
        </tr>
        <tr>
        <td><code>.d-print-inline</code></td>
        <td>Applies <code>display: inline</code> to the element when printing</td>
        </tr>
        <tr>
        <td><code>.d-print-inline-block</code></td>
        <td>Applies <code>display: inline-block</code> to the element when printing</td>
        </tr>
        <tr>
        <td><code>.d-print-none</code></td>
        <td>Applies <code>display: none</code> to the element when printing</td>
        </tr>
    </tbody>
</table>

// stylelint-disable declaration-no-important

//
// Utilities for common `display` values
//

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    @each $value in $displays {
      .d#{$infix}-#{$value} { display: $value !important; }
    }
  }
}


//
// Utilities for toggling `display` in print
//

@media print {
  @each $value in $displays {
    .d-print-#{$value} { display: $value !important; }
  }
}

Embeds

Create responsive video or slideshow embeds based on the width of the parent by creating an intrinsic ratio that scales on any device.

About

Rules are directly applied to <iframe>, <embed>, <video>, and <object> elements; optionally use an explicit descendant class .embed-responsive-item when you want to match the styling for other attributes.

Pro-Tip! You don’t need to include frameborder="0" in your <iframe>s as we override that for you.

Example

Wrap any embed like an <iframe> in a parent element with .embed-responsive and an aspect ratio. The .embed-responsive-item isn’t strictly required, but we encourage it.

<div class="embed-responsive embed-responsive-16by9">
    <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>

Aspect ratios

Aspect ratios can be customized with modifier classes.

<!-- 21:9 aspect ratio -->
<div class="embed-responsive embed-responsive-21by9">
    <iframe class="embed-responsive-item" src="..."></iframe>
</div>
    
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
    <iframe class="embed-responsive-item" src="..."></iframe>
</div>

<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
    <iframe class="embed-responsive-item" src="..."></iframe>
</div>

<!-- 1:1 aspect ratio -->
<div class="embed-responsive embed-responsive-1by1">
    <iframe class="embed-responsive-item" src="..."></iframe>
</div>
<p><strong>Embeds</strong></p>

<p>Create responsive video or slideshow embeds based on the width of the parent by creating an intrinsic ratio that scales on any device.</p>

<p><strong>About</strong></p>

<p>Rules are directly applied to &lt;iframe>, &lt;embed>, &lt;video>, and &lt;object> elements; optionally use an explicit descendant class .embed-responsive-item when you want to match the styling for other attributes.</p>

<p><strong>Pro-Tip!</strong> You don’t need to include frameborder="0" in your &lt;iframe>s as we override that for you.</p>

<p><strong>Example</strong></p>

<p>Wrap any embed like an &lt;iframe> in a parent element with .embed-responsive and an aspect ratio. The .embed-responsive-item isn’t strictly required, but we encourage it.</p>

<div class="mdl-example">
    <div class="container">
        <div class="embed-responsive embed-responsive-16by9">
            <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen=""></iframe>
        </div>
    </div>
<pre>
&lt;div class="embed-responsive embed-responsive-16by9">
    &lt;iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen>&lt;/iframe>
&lt;/div>
</pre>
</div>

<p><strong>Aspect ratios</strong></p>

<p>Aspect ratios can be customized with modifier classes.</p>

<pre>
&lt;!-- 21:9 aspect ratio -->
&lt;div class="embed-responsive embed-responsive-21by9">
    &lt;iframe class="embed-responsive-item" src="...">&lt;/iframe>
&lt;/div>
    
&lt;!-- 16:9 aspect ratio -->
&lt;div class="embed-responsive embed-responsive-16by9">
    &lt;iframe class="embed-responsive-item" src="...">&lt;/iframe>
&lt;/div>

&lt;!-- 4:3 aspect ratio -->
&lt;div class="embed-responsive embed-responsive-4by3">
    &lt;iframe class="embed-responsive-item" src="...">&lt;/iframe>
&lt;/div>

&lt;!-- 1:1 aspect ratio -->
&lt;div class="embed-responsive embed-responsive-1by1">
    &lt;iframe class="embed-responsive-item" src="...">&lt;/iframe>
&lt;/div>
</pre>


// Credit: Nicolas Gallagher and SUIT CSS.

.embed-responsive {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;

  &::before {
    display: block;
    content: "";
  }

  .embed-responsive-item,
  iframe,
  embed,
  object,
  video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }
}

@each $embed-responsive-aspect-ratio in $embed-responsive-aspect-ratios {
  $embed-responsive-aspect-ratio-x: nth($embed-responsive-aspect-ratio, 1);
  $embed-responsive-aspect-ratio-y: nth($embed-responsive-aspect-ratio, 2);

  .embed-responsive-#{$embed-responsive-aspect-ratio-x}by#{$embed-responsive-aspect-ratio-y} {
    &::before {
      padding-top: percentage($embed-responsive-aspect-ratio-y / $embed-responsive-aspect-ratio-x);
    }
  }
}

Overview

These utility classes float an element to the left or right, or disable floating, based on the current viewport size using the CSS float property. !important is included to avoid specificity issues. These use the same viewport breakpoints as our grid system. Please be aware float utilities have no affect on flex items.

Classes

Toggle a float with a class:

Float left on all viewport sizes

Float right on all viewport sizes

Don't float on all viewport sizes
<div class="float-left">Float left on all viewport sizes</div><br>
<div class="float-right">Float right on all viewport sizes</div><br>
<div class="float-none">Don't float on all viewport sizes</div>
    

Mixins

Or by Sass mixin:

.element {
    @include float-left;
    }
.another-element {
    @include float-right;
    }
.one-more {
    @include float-none;
    }

Responsive

Responsive variations also exist for each float value.

Float left on viewports sized SM (small) or wider

Float left on viewports sized MD (medium) or wider

Float left on viewports sized LG (large) or wider

Float left on viewports sized XL (extra-large) or wider

<div class="float-sm-left">Float left on viewports sized SM (small) or wider</div><br>
<div class="float-md-left">Float left on viewports sized MD (medium) or wider</div><br>
<div class="float-lg-left">Float left on viewports sized LG (large) or wider</div><br>
<div class="float-xl-left">Float left on viewports sized XL (extra-large) or wider</div><br>
    

Here are all the support classes;

  • .float-left
  • .float-right
  • .float-none
  • .float-sm-left
  • .float-sm-right
  • .float-sm-none
  • .float-md-left
  • .float-md-right
  • .float-md-none
  • .float-lg-left
  • .float-lg-right
  • .float-lg-none
  • .float-xl-left
  • .float-xl-right
  • .float-xl-none
<p><strong>Overview</strong></p>

<p>These utility classes float an element to the left or right, or disable floating, based on the current viewport size using the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/float">CSS <code>float</code> property</a>. <code>!important</code> is included to avoid specificity issues. These use the same viewport breakpoints as our grid system. Please be aware float utilities have no affect on flex items.</p>

<p><strong>Classes</strong></p>

<p>Toggle a float with a class:</p>

<div class="mdl-example">
    <div class="container">
        <div class="float-left">Float left on all viewport sizes</div><br>
        <div class="float-right">Float right on all viewport sizes</div><br>
        <div class="float-none">Don't float on all viewport sizes</div>
    </div>
    <pre>
&lt;div class="float-left">Float left on all viewport sizes&lt;/div>&lt;br>
&lt;div class="float-right">Float right on all viewport sizes&lt;/div>&lt;br>
&lt;div class="float-none">Don't float on all viewport sizes&lt;/div>
    </pre>
</div>

<p><strong>Mixins</strong></p>

<p>Or by Sass mixin:</p>

<pre class="mdl-code">
.element {
    @include float-left;
    }
.another-element {
    @include float-right;
    }
.one-more {
    @include float-none;
    }
</pre>

<p><strong>Responsive</strong></p>

<p>Responsive variations also exist for each <code>float</code> value.</p>

<div class="mdl-example">
    <div class="container">
        <div class="float-sm-left">Float left on viewports sized SM (small) or wider</div><br>
        <div class="float-md-left">Float left on viewports sized MD (medium) or wider</div><br>
        <div class="float-lg-left">Float left on viewports sized LG (large) or wider</div><br>
        <div class="float-xl-left">Float left on viewports sized XL (extra-large) or wider</div><br>
    </div>
    <pre>
&lt;div class="float-sm-left">Float left on viewports sized SM (small) or wider&lt;/div>&lt;br>
&lt;div class="float-md-left">Float left on viewports sized MD (medium) or wider&lt;/div>&lt;br>
&lt;div class="float-lg-left">Float left on viewports sized LG (large) or wider&lt;/div>&lt;br>
&lt;div class="float-xl-left">Float left on viewports sized XL (extra-large) or wider&lt;/div>&lt;br>
    </pre>
</div>

<p>Here are all the support classes;</p>

<ul>
    <li><code>.float-left</code></li>
    <li><code>.float-right</code></li>
    <li><code>.float-none</code></li>
    <li><code>.float-sm-left</code></li>
    <li><code>.float-sm-right</code></li>
    <li><code>.float-sm-none</code></li>
    <li><code>.float-md-left</code></li>
    <li><code>.float-md-right</code></li>
    <li><code>.float-md-none</code></li>
    <li><code>.float-lg-left</code></li>
    <li><code>.float-lg-right</code></li>
    <li><code>.float-lg-none</code></li>
    <li><code>.float-xl-left</code></li>
    <li><code>.float-xl-right</code></li>
    <li><code>.float-xl-none</code></li>
</ul>
// stylelint-disable declaration-no-important

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    .float#{$infix}-left  { float: left !important; }
    .float#{$infix}-right { float: right !important; }
    .float#{$infix}-none  { float: none !important; }
  }
}
{**
 *
 * The classes are named using the format .font-{name} for all breakpoints.
 *
 * Where name is one of:
 *
 *    first - (by default) Inter 400
 *    first-bold - (by default) Inter 700
 *
 * Font families and weights could be redefine by $font-families variable in vars.scss.
 *
 *}

Inter 400
Inter 700
<pre class="mdl-code">{**
 *
 * The classes are named using the format .font-{name} for all breakpoints.
 *
 * Where name is one of:
 *
<?php
	foreach($fonts as $fontClass => $fontName) {
		echo " *    {$fontClass} - (by default) {$fontName}\n";
	}
?>
 *
 * Font families and weights could be redefine by $font-families variable in vars.scss.
 *
 *}</pre>

<br>

<?php
	foreach($fonts as $fontClass => $fontName) {
		if ($fontIndex > 0) echo "<hr>\n";

		echo "<span class='font-{$fontClass}'>{$fontName}</span>\n";

		$fontIndex++;
	}
?>
.font {

    @each $name, $family in $font-families {

        &-#{$name} {

            @include font-family($name);

            $weights: nth($family, 2);

            @if type-of($weights) == 'map' {

                @each $weight, $number in $weights {

                    &-#{$weight} {

                        @include font-family($name, $number);

                    }

                }

            }

        }

    }

}
{**
 *
 * The classes are named using the format .font-{size} for all breakpoints.
 *
 * Where size is one of:
 *
 *    huge - (by default) 72px
 *    big - (by default) 56px
 *    xx-large - (by default) 40px
 *    x-large - (by default) 32px
 *    large - (by default) 24px
 *    lead - (by default) 20px
 *    normal - (by default) 16px
 *    medium - (by default) 14px
 *    small - (by default) 12px
 *
 * font-size in html element is 62,5% = 10px by default;
 *
 * Sizes values could be redefine by $font-sizes variable in vars.scss.
 *
 *}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
<pre class="mdl-code">{**
 *
 * The classes are named using the format .font-{size} for all breakpoints.
 *
 * Where size is one of:
 *
<?php
	foreach($sizes as $sizeName => $sizeValue) {
		echo " *    {$sizeName} - (by default) {$sizeValue}\n";
	}
?>
 *
 * font-size in html element is 62,5% = 10px by default;
 *
 * Sizes values could be redefine by $font-sizes variable in vars.scss.
 *
 *}</pre>

<br>

<?php
	foreach($sizes as $sizeName => $sizeValue) {
		if ($sizeIndex > 0) echo "<hr>\n";

		echo "<span class='font-{$sizeName}'>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</span>\n";

		$sizeIndex++;
	}
?>
.font {

    @each $name, $size in $font-sizes {

        &-#{$name} {

            @include font-size($name);

        }

    }

}
{**
 *
 * The classes are named using the format .m{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.
 *
 *
 * Where sides is one of:
 *
 *    t - for classes that set margin-top
 *    b - for classes that set margin-bottom
 *    l - for classes that set margin-left
 *    r - for classes that set margin-right
 *    x - for classes that set both *-left and *-right
 *    y - for classes that set both *-top and *-bottom
 *    blank - for classes that set a margin on all 4 sides of the element
 *
 * Where size is one of:
 *
 *    0 - for classes that eliminate the margin or padding by setting it to 0
 *    1 - (by default) for classes that set the margin to $spacer * .25
 *    2 - (by default) for classes that set the margin to $spacer * .5
 *    3 - (by default) for classes that set the margin to $spacer
 *    4 - (by default) for classes that set the margin to $spacer * 1.5
 *    5 - (by default) for classes that set the margin to $spacer * 3
 *    auto - for classes that set the margin to auto
 *
 * $spacer value could be redefine by $spacer variable in vars.scss.
 *
 *}

How it works

Assign responsive-friendly margin or padding values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from .25rem to 3rem.

Notation

Spacing utilities that apply to all breakpoints, from xs to xl, have no breakpoint abbreviation in them. This is because those classes are applied from min-width: 0 and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.

The classes are named using the format {property}{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.

Where property is one of: m - for classes that set margin

Where sides is one of:

  • t - for classes that set margin-top
  • b - for classes that set margin-bottom
  • l - for classes that set margin-left
  • r - for classes that set margin-right
  • x - for classes that set both *-left and *-right
  • y - for classes that set both *-top and *-bottom
  • blank - for classes that set a margin or padding on all 4 sides of the element

Where size is one of:

  • 0 - for classes that eliminate the margin by setting it to 0
  • 1 - (by default) for classes that set the margin to $spacer * .25
  • 2 - (by default) for classes that set the margin to $spacer * .5
  • 3 - (by default) for classes that set the margin to $spacer
  • 4 - (by default) for classes that set the margin to $spacer * 1.5
  • 5 - (by default) for classes that set the margin to $spacer * 3
  • auto - for classes that set the margin to auto

(You can add more sizes by adding entries to the $spacers Sass map variable.)

Example

Here are some representative examples of these classes:

.mt-0 {
    margin-top: 0 !important;
}
    
.ml-1 {
    margin-left: ($spacer * .25) !important;
}
    
.px-2 {
    margin-left: ($spacer * .5) !important;
    margin-right: ($spacer * .5) !important;
}
    
.p-3 {
    margin: $spacer !important;
}

Horizontal centering

Additionally, Bootstrap also includes an .mx-auto class for horizontally centering fixed-width block level content—that is, content that has display: block and a width set—by setting the horizontal margins to auto.

Centered element
<div class="mx-auto" style="width: 200px;">
    Centered element
</div>
mt-1
my-1
mb-1

ml-1
mx-1
mr-1
<pre class="mdl-code">{**
 *
 * The classes are named using the format .m{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.
 *
 *
 * Where sides is one of:
 *
 *    t - for classes that set margin-top
 *    b - for classes that set margin-bottom
 *    l - for classes that set margin-left
 *    r - for classes that set margin-right
 *    x - for classes that set both *-left and *-right
 *    y - for classes that set both *-top and *-bottom
 *    blank - for classes that set a margin on all 4 sides of the element
 *
 * Where size is one of:
 *
 *    0 - for classes that eliminate the margin or padding by setting it to 0
 *    1 - (by default) for classes that set the margin to $spacer * .25
 *    2 - (by default) for classes that set the margin to $spacer * .5
 *    3 - (by default) for classes that set the margin to $spacer
 *    4 - (by default) for classes that set the margin to $spacer * 1.5
 *    5 - (by default) for classes that set the margin to $spacer * 3
 *    auto - for classes that set the margin to auto
 *
 * $spacer value could be redefine by $spacer variable in vars.scss.
 *
 *}</pre>

 <p><strong>How it works</strong></p>

 <p>Assign responsive-friendly <code>margin</code> or <code>padding</code> values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from <code>.25rem</code> to <code>3rem</code>.</p>

 <p><strong>Notation</strong></p>

 <p>Spacing utilities that apply to all breakpoints, from <code>xs</code> to <code>xl</code>, have no breakpoint abbreviation in them. This is because those classes are applied from <code>min-width: 0</code> and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.</p>

 <p n:syntax="off">The classes are named using the format <code>{property}{sides}-{size}</code> for <code>xs</code> and <code>{property}{sides}-{breakpoint}-{size}</code> for <code>sm</code>, <code>md</code>, <code>lg</code>, and <code>xl</code>.</p>

 <p>Where property is one of: <strong>m - for classes that set margin</strong></p>

 <p>Where <strong>sides</strong> is one of:</p>

 <ul>
    <li><code>t</code> - for classes that set <code>margin-top</code></li>
    <li><code>b</code> - for classes that set <code>margin-bottom</code></li>
    <li><code>l</code> - for classes that set <code>margin-left</code></li>
    <li><code>r</code> - for classes that set <code>margin-right</code></li>
    <li><code>x</code> - for classes that set both <code>*-left</code> and <code>*-right</code></li>
    <li><code>y</code> - for classes that set both <code>*-top</code> and <code>*-bottom</code></li>
    <li>blank - for classes that set a <code>margin</code> or <code>padding</code> on all 4 sides of the element</li>
</ul>

<p>Where <strong>size</strong> is one of:</p>

<ul>
    <li><code>0</code> - for classes that eliminate the <code>margin</code> by setting it to <code>0</code></li>
    <li><code>1</code> - (by default) for classes that set the <code>margin</code> to <code>$spacer * .25</code></li>
    <li><code>2</code> - (by default) for classes that set the <code>margin</code> to <code>$spacer * .5</code></li>
    <li><code>3</code> - (by default) for classes that set the <code>margin</code> to <code>$spacer</code></li>
    <li><code>4</code> - (by default) for classes that set the <code>margin</code> to <code>$spacer * 1.5</code></li>
    <li><code>5</code> - (by default) for classes that set the <code>margin</code> to <code>$spacer * 3</code></li>
    <li><code>auto</code> - for classes that set the <code>margin</code> to auto</li>
</ul>

<p>(You can add more sizes by adding entries to the <code>$spacers</code> Sass map variable.)</p>

<p><strong>Example</strong></p>

<p>Here are some representative examples of these classes:</p>

<pre class="mdl-code">
.mt-0 {
    margin-top: 0 !important;
}
    
.ml-1 {
    margin-left: ($spacer * .25) !important;
}
    
.px-2 {
    margin-left: ($spacer * .5) !important;
    margin-right: ($spacer * .5) !important;
}
    
.p-3 {
    margin: $spacer !important;
}
</pre>

<p><strong>Horizontal centering</strong></p>

<p>Additionally, Bootstrap also includes an <code>.mx-auto</code> class for horizontally centering fixed-width block level content—that is, content that has <code>display: block</code> and a <code>width</code> set—by setting the horizontal margins to <code>auto</code>.</p>

<div class="mdl-example">
     <div class="container">
        <div class="mx-auto" style="width: 200px; background-color: rgba(86,61,124,.15); text-align: center">
            Centered element
        </div>
    </div>
<pre>
&lt;div class="mx-auto" style="width: 200px;">
    Centered element
&lt;/div>
</pre>
</div>

<div class="bg-green mt-1">mt-1</div>
<div class="bg-orange my-1">my-1</div>
<div class="bg-red mb-1">mb-1</div>

<hr>

<div class="bg-green d-inline-block ml-1">ml-1</div>
<div class="bg-orange d-inline-block mx-1">mx-1</div>
<div class="bg-red d-inline-block mr-1">mr-1</div>
// stylelint-disable declaration-no-important

// Margin and Padding

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    @each $prop, $abbrev in (margin: m, padding: p) {
      @each $size, $length in $spacers {
        .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
        .#{$abbrev}t#{$infix}-#{$size},
        .#{$abbrev}y#{$infix}-#{$size} {
          #{$prop}-top: $length !important;
        }
        .#{$abbrev}r#{$infix}-#{$size},
        .#{$abbrev}x#{$infix}-#{$size} {
          #{$prop}-right: $length !important;
        }
        .#{$abbrev}b#{$infix}-#{$size},
        .#{$abbrev}y#{$infix}-#{$size} {
          #{$prop}-bottom: $length !important;
        }
        .#{$abbrev}l#{$infix}-#{$size},
        .#{$abbrev}x#{$infix}-#{$size} {
          #{$prop}-left: $length !important;
        }
      }
    }

    // Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
    @each $size, $length in $spacers {
      @if $size != 0 {
        .m#{$infix}-n#{$size} { margin: -$length !important; }
        .mt#{$infix}-n#{$size},
        .my#{$infix}-n#{$size} {
          margin-top: -$length !important;
        }
        .mr#{$infix}-n#{$size},
        .mx#{$infix}-n#{$size} {
          margin-right: -$length !important;
        }
        .mb#{$infix}-n#{$size},
        .my#{$infix}-n#{$size} {
          margin-bottom: -$length !important;
        }
        .ml#{$infix}-n#{$size},
        .mx#{$infix}-n#{$size} {
          margin-left: -$length !important;
        }
      }
    }

    // Some special margin utils
    .m#{$infix}-auto { margin: auto !important; }
    .mt#{$infix}-auto,
    .my#{$infix}-auto {
      margin-top: auto !important;
    }
    .mr#{$infix}-auto,
    .mx#{$infix}-auto {
      margin-right: auto !important;
    }
    .mb#{$infix}-auto,
    .my#{$infix}-auto {
      margin-bottom: auto !important;
    }
    .ml#{$infix}-auto,
    .mx#{$infix}-auto {
      margin-left: auto !important;
    }
  }
}
{**
 *The classes are named using the format .p{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.
 *
 *
 * Where sides is one of:
 *
 *    t - for classes that set padding-top
 *    b - for classes that set padding-bottom
 *    l - for classes that set padding-left
 *    r - for classes that set padding-right
 *    x - for classes that set both *-left and *-right
 *    y - for classes that set both *-top and *-bottom
 *    blank - for classes that set a padding on all 4 sides of the element
 *
 * Where size is one of:
 *
 *    0 - for classes that eliminate the padding or padding by setting it to 0
 *    1 - (by default) for classes that set the padding to $spacer * .25
 *    2 - (by default) for classes that set the padding to $spacer * .5
 *    3 - (by default) for classes that set the padding to $spacer
 *    4 - (by default) for classes that set the padding to $spacer * 2
 *    25 - (by default) for classes that set the padding to 25% of width
 *    50 - (by default) for classes that set the padding to 50% of width
 *    75 - (by default) for classes that set the padding to 75% of width
 *    100 - (by default) for classes that set the padding to 100% of width
 *
 * $spacer value could be redefine by $spacer variable in vars.scss.
 *}

How it works

Assign responsive-friendly padding values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from .25rem to 3rem.

Notation

Spacing utilities that apply to all breakpoints, from xs to xl, have no breakpoint abbreviation in them. This is because those classes are applied from min-width: 0 and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.

The classes are named using the format {property}{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.

Where property is one of: p - for classes that set padding

Where sides is one of:

  • t - for classes that set padding-top
  • b - for classes that set padding-bottom
  • l - for classes that set padding-left
  • r - for classes that set padding-right
  • x - for classes that set both *-left and *-right
  • y - for classes that set both *-top and *-bottom
  • blank - for classes that set a padding or padding on all 4 sides of the element

Where size is one of:

  • 0 - for classes that eliminate the padding by setting it to 0
  • 1 - (by default) for classes that set the padding to $spacer * .25
  • 2 - (by default) for classes that set the padding to $spacer * .5
  • 3 - (by default) for classes that set the padding to $spacer
  • 4 - (by default) for classes that set the padding to $spacer * 1.5
  • 5 - (by default) for classes that set the padding to $spacer * 3
  • auto - for classes that set the padding to auto

(You can add more sizes by adding entries to the $spacers Sass map variable.)

Example

Here are some representative examples of these classes:

.mt-0 {
    padding-top: 0 !important;
}
    
.ml-1 {
    padding-left: ($spacer * .25) !important;
}
    
.px-2 {
    padding-left: ($spacer * .5) !important;
    padding-right: ($spacer * .5) !important;
}
    
.p-3 {
    padding: $spacer !important;
}

pt-1
py-1
pb-1

pl-1
px-1
pr-1
<pre class="mdl-code">{**
 *The classes are named using the format .p{sides}-{size} for xs and {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.
 *
 *
 * Where sides is one of:
 *
 *    t - for classes that set padding-top
 *    b - for classes that set padding-bottom
 *    l - for classes that set padding-left
 *    r - for classes that set padding-right
 *    x - for classes that set both *-left and *-right
 *    y - for classes that set both *-top and *-bottom
 *    blank - for classes that set a padding on all 4 sides of the element
 *
 * Where size is one of:
 *
 *    0 - for classes that eliminate the padding or padding by setting it to 0
 *    1 - (by default) for classes that set the padding to $spacer * .25
 *    2 - (by default) for classes that set the padding to $spacer * .5
 *    3 - (by default) for classes that set the padding to $spacer
 *    4 - (by default) for classes that set the padding to $spacer * 2
 *    25 - (by default) for classes that set the padding to 25% of width
 *    50 - (by default) for classes that set the padding to 50% of width
 *    75 - (by default) for classes that set the padding to 75% of width
 *    100 - (by default) for classes that set the padding to 100% of width
 *
 * $spacer value could be redefine by $spacer variable in vars.scss.
 *}</pre>

 <p><strong>How it works</strong></p>

 <p>Assign responsive-friendly <code>padding</code> values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from <code>.25rem</code> to <code>3rem</code>.</p>

 <p><strong>Notation</strong></p>

 <p>Spacing utilities that apply to all breakpoints, from <code>xs</code> to <code>xl</code>, have no breakpoint abbreviation in them. This is because those classes are applied from <code>min-width: 0</code> and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.</p>

 <p n:syntax="off">The classes are named using the format <code>{property}{sides}-{size}</code> for <code>xs</code> and <code>{property}{sides}-{breakpoint}-{size}</code> for <code>sm</code>, <code>md</code>, <code>lg</code>, and <code>xl</code>.</p>

 <p>Where property is one of: <strong>p - for classes that set padding</strong></p>

 <p>Where <strong>sides</strong> is one of:</p>

 <ul>
    <li><code>t</code> - for classes that set <code>padding-top</code></li>
    <li><code>b</code> - for classes that set <code>padding-bottom</code></li>
    <li><code>l</code> - for classes that set <code>padding-left</code></li>
    <li><code>r</code> - for classes that set <code>padding-right</code></li>
    <li><code>x</code> - for classes that set both <code>*-left</code> and <code>*-right</code></li>
    <li><code>y</code> - for classes that set both <code>*-top</code> and <code>*-bottom</code></li>
    <li>blank - for classes that set a <code>padding</code> or <code>padding</code> on all 4 sides of the element</li>
</ul>

<p>Where <strong>size</strong> is one of:</p>

<ul>
    <li><code>0</code> - for classes that eliminate the <code>padding</code> by setting it to <code>0</code></li>
    <li><code>1</code> - (by default) for classes that set the <code>padding</code> to <code>$spacer * .25</code></li>
    <li><code>2</code> - (by default) for classes that set the <code>padding</code> to <code>$spacer * .5</code></li>
    <li><code>3</code> - (by default) for classes that set the <code>padding</code> to <code>$spacer</code></li>
    <li><code>4</code> - (by default) for classes that set the <code>padding</code> to <code>$spacer * 1.5</code></li>
    <li><code>5</code> - (by default) for classes that set the <code>padding</code> to <code>$spacer * 3</code></li>
    <li><code>auto</code> - for classes that set the <code>padding</code> to auto</li>
</ul>

<p>(You can add more sizes by adding entries to the <code>$spacers</code> Sass map variable.)</p>

<p><strong>Example</strong></p>

<p>Here are some representative examples of these classes:</p>

<pre class="mdl-code">
.mt-0 {
    padding-top: 0 !important;
}
    
.ml-1 {
    padding-left: ($spacer * .25) !important;
}
    
.px-2 {
    padding-left: ($spacer * .5) !important;
    padding-right: ($spacer * .5) !important;
}
    
.p-3 {
    padding: $spacer !important;
}
</pre>

<p></p>

<div class="bg-green pt-1">pt-1</div>
<div class="bg-orange py-1">py-1</div>
<div class="bg-red pb-1">pb-1</div>

<hr>

<div class="bg-green d-inline-block pl-1">pl-1</div>
<div class="bg-orange d-inline-block px-1">px-1</div>
<div class="bg-red d-inline-block pr-1">pr-1</div>
// stylelint-disable declaration-no-important

// Margin and Padding

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    @each $prop, $abbrev in (margin: m, padding: p) {
      @each $size, $length in $spacers {
        .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
        .#{$abbrev}t#{$infix}-#{$size},
        .#{$abbrev}y#{$infix}-#{$size} {
          #{$prop}-top: $length !important;
        }
        .#{$abbrev}r#{$infix}-#{$size},
        .#{$abbrev}x#{$infix}-#{$size} {
          #{$prop}-right: $length !important;
        }
        .#{$abbrev}b#{$infix}-#{$size},
        .#{$abbrev}y#{$infix}-#{$size} {
          #{$prop}-bottom: $length !important;
        }
        .#{$abbrev}l#{$infix}-#{$size},
        .#{$abbrev}x#{$infix}-#{$size} {
          #{$prop}-left: $length !important;
        }
      }
    }

    // Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
    @each $size, $length in $spacers {
      @if $size != 0 {
        .m#{$infix}-n#{$size} { margin: -$length !important; }
        .mt#{$infix}-n#{$size},
        .my#{$infix}-n#{$size} {
          margin-top: -$length !important;
        }
        .mr#{$infix}-n#{$size},
        .mx#{$infix}-n#{$size} {
          margin-right: -$length !important;
        }
        .mb#{$infix}-n#{$size},
        .my#{$infix}-n#{$size} {
          margin-bottom: -$length !important;
        }
        .ml#{$infix}-n#{$size},
        .mx#{$infix}-n#{$size} {
          margin-left: -$length !important;
        }
      }
    }

    // Some special margin utils
    .m#{$infix}-auto { margin: auto !important; }
    .mt#{$infix}-auto,
    .my#{$infix}-auto {
      margin-top: auto !important;
    }
    .mr#{$infix}-auto,
    .mx#{$infix}-auto {
      margin-right: auto !important;
    }
    .mb#{$infix}-auto,
    .my#{$infix}-auto {
      margin-bottom: auto !important;
    }
    .ml#{$infix}-auto,
    .mx#{$infix}-auto {
      margin-left: auto !important;
    }
  }
}

Screenreaders

Use screenreader utilities to hide elements on all devices except screen readers.

Hide an element to all devices except screen readers with .sr-only. Combine .sr-only with .sr-only-focusable to show the element again when it’s focused (e.g. by a keyboard-only user). Can also be used as mixins.

<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
// Usage as a mixin
.skip-navigation {
    @include sr-only;
    @include sr-only-focusable;
}
<p><strong>Screenreaders</strong></p>

<p>Use screenreader utilities to hide elements on all devices except screen readers.</p>

<p>Hide an element to all devices <strong>except screen readers</strong> with <strong>.sr-only</strong>. Combine <strong>.sr-only</strong> with <strong>.sr-only-focusable</strong> to show the element again when it’s focused (e.g. by a keyboard-only user). Can also be used as mixins.</p>

<pre class="mdl-code">
&lt;a class="sr-only sr-only-focusable" href="#content">Skip to main content&lt;/a>
</pre>
<pre class="mdl-code">
// Usage as a mixin
.skip-navigation {
    @include sr-only;
    @include sr-only-focusable;
}
</pre>

// Only display content to screen readers
//
// See: https://a11yproject.com/posts/how-to-hide-content/
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/

@mixin sr-only() {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px; // Fix for https://github.com/twbs/bootstrap/issues/25686
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

// Use in conjunction with .sr-only to only display content when it's focused.
//
// Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
//
// Credit: HTML5 Boilerplate

@mixin sr-only-focusable() {
  &:active,
  &:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
}

Sizing

Easily make an element as wide or as tall (relative to its parent) with our width and height utilities.

Width and height utilities are generated from the $sizes Sass map in vars.scss. Includes support for 25%, 50%, 75%, and 100% by default. Modify those values as you need to generate different utilities here.

Width 25%
Width 50%
Width 75%
Width 100%
<div class="w-25 p-1" style="background-color: #eee;">Width 25%</div>
<div class="w-50 p-1" style="background-color: #eee;">Width 50%</div>
<div class="w-75 p-1" style="background-color: #eee;">Width 75%</div>
<div class="w-100 p-1" style="background-color: #eee;">Width 100%</div>

Height 25%
Height 50%
Height 75%
Height 100%
<div style="height: 100px; background-color: rgba(255,0,0,0.1);">
    <div class="h-25 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 25%</div>
    <div class="h-50 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 50%</div>
    <div class="h-75 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 75%</div>
    <div class="h-100 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 100%</div>
</div>

You can also use max-width: 100%; and max-height: 100%; utilities as needed.

Max-width = 100% [1000%x100]
<img class="mw-100" src="..." alt="Max-width 100%">

Max-height 100%
<div style="height: 100px; background-color: rgba(255,0,0,0.1);">
    <div class="mh-100" style="width: 100px; height: 200px; background-color: rgba(0,0,255,0.1);">Max-height 100%</div>
</div>
<p><strong>Sizing</strong></p>

<p>Easily make an element as wide or as tall (relative to its parent) with our width and height utilities.</p>

<p>Width and height utilities are generated from the <strong>$sizes</strong> Sass map in <strong>vars.scss</strong>. Includes support for <strong>25%</strong>, <strong>50%</strong>, <strong>75%</strong>, and <strong>100%</strong> by default. Modify those values as you need to generate different utilities here.</p>

<div class="mdl-example">
    <div class="container">
        <div class="w-25 p-1" style="background-color: #eee;">Width 25%</div>
        <div class="w-50 p-1" style="background-color: #eee;">Width 50%</div>
        <div class="w-75 p-1" style="background-color: #eee;">Width 75%</div>
        <div class="w-100 p-1" style="background-color: #eee;">Width 100%</div>
    </div>
<pre>
&lt;div class="w-25 p-1" style="background-color: #eee;">Width 25%&lt;/div>
&lt;div class="w-50 p-1" style="background-color: #eee;">Width 50%&lt;/div>
&lt;div class="w-75 p-1" style="background-color: #eee;">Width 75%&lt;/div>
&lt;div class="w-100 p-1" style="background-color: #eee;">Width 100%&lt;/div>
</pre>
</div>

<p></p>

<div class="mdl-example">
    <div class="container">
        <div style="height: 100px; background-color: rgba(255,0,0,0.1);">
            <div class="h-25 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 25%</div>
            <div class="h-50 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 50%</div>
            <div class="h-75 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 75%</div>
            <div class="h-100 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 100%</div>
        </div>
    </div>
<pre>
&lt;div style="height: 100px; background-color: rgba(255,0,0,0.1);">
    &lt;div class="h-25 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 25%&lt;/div>
    &lt;div class="h-50 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 50%&lt;/div>
    &lt;div class="h-75 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 75%&lt;/div>
    &lt;div class="h-100 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 100%&lt;/div>
&lt;/div>
</pre>
</div>

<p>You can also use <strong>max-width: 100%;</strong> and <strong>max-height: 100%;</strong> utilities as needed.</p>

<div class="mdl-example">
    <div class="container">
        <img class="mw-100" alt="Max-width = 100% [1000%x100]" style="height: 100px; width: 1000%; display: block;" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22815%22%20height%3D%22100%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20815%20100%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_164cc889977%20text%20%7B%20fill%3Argba(255%2C255%2C255%2C.75)%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A41pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_164cc889977%22%3E%3Crect%20width%3D%22815%22%20height%3D%22100%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22181.921875%22%20y%3D%2268.9%22%3EMax-width%20%3D%20100%25%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
    </div>
<pre>
&lt;img class="mw-100" src="..." alt="Max-width 100%">
</pre>
</div>

<p></p>

<div class="mdl-example">
    <div class="container">
        <div style="height: 100px; background-color: rgba(255,0,0,0.1);">
            <div class="mh-100" style="width: 100px; height: 200px; background-color: rgba(0,0,255,0.1);">Max-height 100%</div>
        </div>
    </div>
<pre>
&lt;div style="height: 100px; background-color: rgba(255,0,0,0.1);">
    &lt;div class="mh-100" style="width: 100px; height: 200px; background-color: rgba(0,0,255,0.1);">Max-height 100%&lt;/div>
&lt;/div>
</pre>
</div>
// stylelint-disable declaration-no-important

// Width and height

@each $prop, $abbrev in (width: w, height: h) {
  @each $size, $length in $sizes {
    .#{$abbrev}-#{$size} { #{$prop}: $length !important; }
  }
}

.mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; }

// Viewport additional helpers

.min-vw-100 { min-width: 100vw !important; }
.min-vh-100 { min-height: 100vh !important; }

.vw-100 { width: 100vw !important; }
.vh-100 { height: 100vh !important; }
{**
 *
 * The classes are named using the format .text-{align} for xs and text-{size}-{align} for all breakpoints.
 *
 * Where align is one of:
 *
 *    right
 *    left
 *    center
 *
 *}

Lorem Ipsum

Lorem Ipsum

Lorem Ipsum

{**
 *
 * The classes are named using the format .text-{transform} for all breakpoints.
 *
 * Where transform is one of:
 *
 *    lowercase
 *    uppercase
 *    capitalize
 *
 *}

Lorem ipsum

Lorem ipsum

Lorem ipsum

{**
 *
 * The classes are named using the format .text-underline-{property} for all breakpoints.
 *
 * Where property is one of:
 *
 *    never - never underline
 *    on-hover - underline only on hover
 *    remove-on-hover - remove underline on hover
 *
 *}

Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
<pre class="mdl-code">{**
 *
 * The classes are named using the format .text-{align} for xs and text-{size}-{align} for all breakpoints.
 *
 * Where align is one of:
 *
 *    right
 *    left
 *    center
 *
 *}</pre>

<br>

<div class="bg-green text-right">Lorem Ipsum</div>

<hr>

<div class="bg-orange text-center">Lorem Ipsum</div>

<hr>

<div class="bg-red text-left">Lorem Ipsum</div>

<hr>

<pre class="mdl-code">{**
 *
 * The classes are named using the format .text-{transform} for all breakpoints.
 *
 * Where transform is one of:
 *
 *    lowercase
 *    uppercase
 *    capitalize
 *
 *}</pre>

<br>

<div class="text-lowercase">Lorem ipsum</div>

<hr>

<div class="text-uppercase">Lorem ipsum</div>

<hr>

<div class="text-capitalize">Lorem ipsum</div>

<hr>

<pre class="mdl-code">{**
 *
 * The classes are named using the format .text-underline-{property} for all breakpoints.
 *
 * Where property is one of:
 *
 *    never - never underline
 *    on-hover - underline only on hover
 *    remove-on-hover - remove underline on hover
 *
 *}</pre>

<br>

<a href="#" class="text-underline-never">Lorem Ipsum</a>

<hr>

<a href="#" class="text-underline-on-hover">Lorem Ipsum</a>

<hr>

<a href="#" class="text-underline text-underline-remove-on-hover">Lorem Ipsum</a>
.text {

    &-justify {

        text-align: justify;

    }

    &-nowrap {

        white-space: nowrap;

    }

    &-truncate {

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

    }

    @each $breakpoint in map-keys($grid-breakpoints) {

        @include media-breakpoint-up($breakpoint) {

            $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

            &#{$infix}-left {

                text-align: left;

            }

            &#{$infix}-right {

                text-align: right;

            }

            &#{$infix}-center {

                text-align: center;

            }

        }

    }

    &-lowercase {

        text-transform: lowercase;

    }

    &-uppercase {

        text-transform: uppercase;

    }

    &-capitalize {

        text-transform: capitalize;

    }

    &-hide {

        @include text-hide();

    }

    &-underline {

        @include text-underline(underline);

        &-never {

            @include text-underline(none);

        }

        &-on-hover {

            @include text-underline(none, underline);

        }

        &-remove-on-hover {

            @include text-underline(underline, none);

        }

    }

}

Connected Normalize.css

<?php
	echo $this->templateCard('Connected <a href="https://github.com/necolas/normalize.css/" target="_blank">Normalize.css</a>');
?>
/* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */

@import "~normalize.css/normalize.css";