The padding in CSS means the outside space around an element’s content and inside space of the border etc.
Padding on individual Sides of an Element separately in CSS
1 2 3 4 5 6 7 8 |
.p { border: 5px groove blue; background-color: lightgray; padding-top: 90px; padding-right: 60px; padding-bottom: 85px; padding-left: 80px; } |
Shorthand Property of Padding by 1 values in CSS
1 2 3 4 5 |
div { border
: 5px solid purple; padding: 50px; background-color: lightpink; } |
Shorthand Property of Padding by 2 values in CSS
1 2 3 4 5 |
div { border: 5px solid purple; padding: 20px 30px; background-color: lightpink; } |
Shorthand Property of Padding by 3 values in CSS
1 2 3 4 5 |
div { border: 7px solid red; padding: 50px 75px 100px; background-color: lightgray; } |
Shorthand Property of Padding by 4 values in CSS
1 2 3 4 5 |
div { border: 7px solid purple; padding: 30px 60px 90px 120px; background-color: pink; } |