Utility Layout
Change the default document flow with these display, float, and other utilities.
Display
To adjust the display of an element, use the .block
, .inline
, .inline-block
, .table
, and .table-cell
utilities.
<div class="inline">inline</div>
<div class="inline-block">inline-block</div>
<a href="#" class="block">block</a>
<div class="table">
<div class="table-cell">table-cell</div>
<div class="table-cell">table-cell</div>
</div>
Overflow
To adjust element overflow, use .overflow-hidden
, .overflow-scroll
, and .overflow-auto
.
.overflow-hidden
can also be used to create a new block formatting context or clear floats.
Floats
Use .clearfix
, .left
, and .right
to clear and set floats.
<div class="clearfix border border-blue">
<div class="left border border-blue">.left</div>
<div class="right border border-blue">.right</div>
</div>
Max Width
Use .fit
to set max-width 100%.
Box-Sizing Border-Box
Use .border-box
to set box-sizing border-box per element.
<div class="col-6 p2 border-box border">.border-box</div>
Media Object
Create a media object using basic utilities.
Body Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison.
<div class="clearfix mb2 border border-blue">
<div class="left p2 mr1 border border-blue">Image</div>
<div class="overflow-hidden">
<p><b>Body</b> Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison.</p>
</div>
</div>
Double-Sided Media Object
For a container with a flexible center, use a double-sided media object.
Body Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison.
<div class="clearfix mb2 border border-blue">
<div class="left p2 mr1 border border-blue">Image</div>
<div class="right p2 ml1 border border-blue">Image</div>
<div class="overflow-hidden">
<p><b>Body</b> Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison.</p>
</div>
</div>
CSS Source
.inline { display: inline } .block { display: block } .inline-block { display: inline-block } .table { display: table } .table-cell { display: table-cell } .overflow-hidden { overflow: hidden } .overflow-scroll { overflow: scroll } .overflow-auto { overflow: auto } .clearfix:before, .clearfix:after { content: " "; display: table } .clearfix:after { clear: both } .left { float: left } .right { float: right } .fit { max-width: 100% } .border-box { box-sizing: border-box }