Skip to content
Justice Tech School

Shorthand Properties

Shorthands set several properties at once: margin, padding, border, background, font and flex. Values for four sides run clockwise: top, right, bottom, left.

Example
<style>
.box { margin: 10px 20px; padding: 5px 10px 15px 20px; border: 2px solid #14b8a6; background: #1e293b }
</style>
<div class="box">margin, padding and border shorthand</div>

Exercise

Order of sides.

margin: top  bottom left

Quiz Test

In which order are four values read?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.