Skip to Main Content

Margins & Padding

Using Margins & Padding

These attributes allow you to control the amount of margin space or padding at a granular level. They support a similar shorthand to CSS where you supply the side and the value you want.

Markup

<div data-c-margin="SIDE(VALUE)"></div>

<div data-c-padding="SIDE(VALUE)"></div>

Available Arguments

# SIDE

all
top
right
bottom
left
tb (Top and Bottom)
rl (Right and Left)
# VALUE

.25
.5
1
2
3
4

In Practice

<!--A double value margin on all sides.-->
<div data-c-margin="all(2)"></div>
<!--Double value on top, normal on the sides, and triple value on the bottom.-->
<div data-c-padding="top(2) right(1) bottom(3) left(1)"></div>

Changelog

Version 2.4.10

Version 2.3.15

Version 2.3.4