CSS Margin

 Eduaction Management 959 Lahore

Code With Jahangir

CSS Margin

FREE COURSES

FREE CERTIFICATE

CSS Margin

In margin property unlike padding, the background of the text is also included while adding the space between content and element.

 

Eg:

 

Output:

You can add margins for individual elements as well by adding two or more values for it.

 

Margin Collapse

When two margins from different elements overlap, the resulting margin is common to both of them. For eg: I give a margin of 5px on one element and 2px to another. In the end, the margin of 5px would be taken as the rule for both of them.

Eduaction Management 959 Lahore

Code With Jahangir

CSS Margin

FREE COURSES

FREE CERTIFICATE

Previous Post Next Post

Contact Form