CSS Learning - Page 05

Date: Feb 27, 2026 13:19

Margins and Padding

Paragraph one

Paragraph two

Paragraph three

Margin Top Example

Margin Right Example

Margin Bottom Example

Margin Left Example

When using two values, the first value applies to the top and bottom, while the second value applies to the left and right sides of the element

If three values are provided, the first value applies to the top margin, the second value to the left and right margin, and the third value to the bottom margin.

When using four values, this gives you more control, as you can independently specify each margin value for each side of the target element. The first value applies to the top margin, the second value to the right margin, the third value to the bottom margin, and the fourth value to the left margin.

This paragraph has padding