CSS Margin


Prev Tutorial Next Tutorial

CSS Margin

The margin are used for give sufficient space around an element (outside the border). The margin does not have a background color, and it is completely transparent. Margin have four properties which is given below;

  • top
  • bottom
  • left
  • right

Example

<html>
<body>
<p style="margin-top:100px;"> Margin from top</p>
<p style="margin-bottom:100px;">Margin from bottom</p>
<p style="margin-right:50px;">Margin from right</p>
<p style="margin-left:50px;">Margin from left</p>
</body>
</html>

Output

Margin from top

Margin from bottom

Margin from right

Margin from left

Browser supported

Properties
marginYesYesYesYesYes

Prev Tutorial Next Tutorial

Advertisements
Download Projects

Advertisements

Download WhatsApp Status Video

Buy This Ad Space Only $50 per Month, Ad Size 300X250 Contact on: [email protected] WhatsApp no. 8882538826

Google Adsense Advertisements