Padding
A collection of utility classes to add spacing between elements and their content.
Usage
To apply this component, add one of the following classes to a block element.
Class | Size |
---|---|
.uk-padding-xsmall | 0.25rem or 4px |
.uk-padding-small | 0.5rem or 8px |
.uk-padding | 1rem or 16px |
.uk-padding-medium | 2.5rem or 40px |
.uk-padding-large | 5rem or 80px |
.uk-padding-xlarge | 10rem or 160px |
<div class="uk-padding"></div>
Position
To add margin to a specific side, use the uk-padding-[size]-[side]
format. For example, uk-padding-small-top
, uk-padding-xsmall-bottom
, etc.
<div class="uk-padding-small-top"></div>
Remove padding
In some cases you want to remove padding from an element, rather than adding it. To do so, apply one of the following classes.
Class | Description |
---|---|
.uk-padding-remove | Removes all padding from an element. |
.uk-padding-remove-top | Removes top padding from an element. |
.uk-padding-remove-bottom | Removes bottom padding from an element. |
.uk-padding-remove-left | Removes left padding from an element. |
.uk-padding-remove-right | Removes right padding from an element. |
.uk-padding-remove-vertical | Removes top and bottom padding from an element. |
.uk-padding-remove-horizontal | Removes left and right padding from an element. |
- On This Page
- Usage
- Position
- Remove padding