View video tutorial

CSS Margin

CSS

This defines space around elements outside the border..

CSS margin

Margins are used to create space around elements outside the border.

Example

.p1 {
  margin: 25px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


Sample Code

Copy each file contents and paste it to your own project and run to see the final output

Example

.p1 {
  margin: 25px 50px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.