Malwinder Malwinder - 9 days ago 7
CSS Question

Order of CSS margin

What is order of writing margins in CSS?
For example:

div
{
margin: 20px 40px 30px 50px;
}


Which one these represent Margin from top, bottom, left and right?

Roi Roi
Answer
margin: top right bottom left //4 parameters 10px 12px 13px 15px
margin: top horizontal bottom //3 parameters 10px 12px 13px, gives left & right same margin of 12px
margin: vertical horizontal //2 parameters 10px 20px, gives 10px for top/bottom and 20px for left/right
Comments