CSS Margins



Using CSS margin properties, you can define the space around elements.

The CSS margin properties define the space around elements. You can also use negative values to overlap content. The top, right, bottom, and left margin can be changed separately using separate properties. Even yo can use shorthand margin property  to change all of the margins at once.

Following properties are included in css margin property :

- margin
- margin-bottom
- margin-left
- margin-right
- margin-top
 

Example:
p {
margin: 5px;
border: 1px solid black;
}

 

USEFUL CSS PROPERTY

  • border-spacing
  • border-left
  • border-right
  • border-bottom
  • border-top
  • text-align
  • color
  • float
  • font
  • visibility
  • position