Language selection

Search


Spacing

Utility classes to add spacing between elements.

This page showcases wet-boew utility features including some integration from Bootstrap 4.

Please note that some backported Bootstrap 4 classes have been adjusted to follow Bootstrap 3.4's view breakpoints. For example, small (sm) view's minimum width is 768px in Bootstrap 3.4, as opposed to 576px in Bootstrap 4.

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.

Notation

Spacing utilities that apply to all breakpoints, from xs to lg, 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, and lg.

Where property is one of:

Where sides is one of:

Where size is one of:

Some working examples

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Lorem ipsum dolor sit amet.

Code sample

<p class="bg-primary mb-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>
<p class="bg-primary px-3">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>
<p class="bg-primary mt-sm-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>
<div class="d-flex">
	<div class="col-xs-6 mx-auto"><p class="bg-primary">Lorem ipsum dolor sit amet.</p></div>
</div>

Additional spacing classes

mrgn-{position}-{size}

Where position is one of:

Where size is one of:

Working examples

No margin (top, bottom, left, and right)

Small margin (top, bottom, left, and right)

Medium margin (top, bottom, left, and right)

Large margin (top, bottom, left, and right)

Extra large margin (top, bottom, left, and right)

Code sample
<p class="bg-primary mrgn-tp-0 mrgn-rght-0 mrgn-bttm-0 mrgn-lft-0">No margin (top, bottom, left, and right)</p>
<p class="bg-primary mrgn-tp-sm mrgn-rght-sm mrgn-bttm-sm mrgn-lft-sm">Small margin (top, bottom, left, and right)</p>
<p class="bg-primary mrgn-tp-md mrgn-rght-md mrgn-bttm-md mrgn-lft-md">Medium margin (top, bottom, left, and right)</p>
<p class="bg-primary mrgn-tp-lg mrgn-rght-lg mrgn-bttm-lg mrgn-lft-lg">Large margin (top, bottom, left, and right)</p>
<p class="bg-primary mrgn-tp-xl mrgn-rght-xl mrgn-bttm-xl mrgn-lft-xl">Extra large margin (top, bottom, left, and right)</p>

Legacy

Recommendation, don't use them. Those are legacy style from WET-BOEW 3 that are still in our code base.

margin-bottom-none

Removes bottom margin.

Working example

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Code sample
<p class="margin-bottom-none">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>

margin-bottom-small

Adds a bottom margin of .25em.

Working example

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Code sample
<p class="margin-bottom-small">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>

margin-top-medium

Adds a top margin of .75em.

Working example

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Code sample
<p class="margin-top-medium">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>

margin-top-large

Adds a top margin of 1.5em.

Working example

Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.

Code sample
<p class="margin-top-large">Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, magnam.</p>

Page details

Date modified: