Margin property in CSS is used to make the gab between two border property in CSS. It is very usable property in CSS.
- Margin can be :
- Margin-top:10px;
- Margin-right:10px;
- Margin-:bottom:10px;
- Margin-left:10px;
Margin property in CSS work in anti clock wise direction and its short hand is very easy:
- Margin :10px 10px 20px 20px ;
Which starts from top right bottom left;
Similarly, if we want to fixed the same margin in all side then the short hand is
There is one property of margin which is auto it is used to put the div in center.
- Margin can be :
- Margin-top:10px;
- Margin-right:10px;
- Margin-:bottom:10px;
- Margin-left:10px;
Note we have to use width property with margin to run it.