Display
Single purpose classes for setting the display of an element at any breakpoint.
Block
.db { display: block; }
<span class="db"></span>
Block will inherently set width to 100% of its parent element. It will also cause a line break, even if the declared width doesn't take up the full width of the parent.
block
block
Inline-Block
.dib { display: inline-block; }
<span class="dib"></span>
Inline-block will wrap around content inline. It also allows you to set height and width properties on the element, which display inline does not allow you to do. It does render the white-space inbeween elements, so if you set width: 25% to four elements
they will not just render as a 4 column layout by default.
display: inline-block
display: inline-block
display: inline-block
display: inline-block
Inline
.di { display: inline; }
<div class="di"></div>
Set content inline. Inline doesn't respect height or width values. It does not render white space between elements.
display: inline
display: inline
display: inline
display: inline
Table
.dt { display: table; }
.dtc { display: table-cell; }
<div class="dt">
<div class="dtc"></div>
<div class="dtc"></div>
</div>
The display table can be combined with display table-cell to render a table without table markup. This can be useful for vertically aligning content or for auto-calculating a variable number of table cells. To auto-calculate even widths for all cells,
you must extend display table with .dt--fixed
to set table-layout: fixed.
display
table
will automatically
compute cell width
Table
<div class="dt dt--fixed w-100">
<div class="dtc"></div>
<div class="dtc"></div>
</div>
display table
with table-layout: fixed
will automatically
make every cell the same width regardless of the content
None
.dn { display: none; }
<div class="dn"></div>
You can set the display of any element to none by tacking on the dn
class.
Flex & Inline Flex
While flex and inline-flex are display properties, they are documented in the Flexbox Section