10-CSS Margin Properties

0
130

The CSS margin properties are used to generate space around elements kn a given webpage according to the users needs.

 

Margin – Individual Sides

Different margins  provided in webpage are

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

 

Example:
[html]

p.example {
border:1px solid yellow;
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}

 

different margin properties

This is a paragraph which has not been provided any specified margins.

This paragraph uses top and bottom margin of 100px, a left margin of 80px, and a right margin of 150px.

 

[/html]
Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.