All about CSS padding and margin elements

css padding and margin

Margin and padding are the two most commonly used properties for spacing-out elements. A margin is the space outside of the element and padding is the space inside the element. Little explanation about css and padding.

padding: 5px 10px 15px 20px;

That means :

padding-top - 5px
padding-right - 10px
padding-bottom - 15px
padding-left - 20px


padding: 5px 10px 15px;

That means :

padding-top - 5px
padding left and riight - 10px
padding-bottom - 15px


padding: 5px 10px;

That means :

padding top and bottom - 5px
padding left and right - 10px


padding: 5px;

That means :

padding top, right, bottom and left - 25px

Related Posts



0 comments: