Site icon T4Tutorials.com

Padding CSS

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

.p { 
    border: 5px groove blue;
    background-color: lightgray;
    padding-top: 90px;
    padding-right: 60px;
    padding-bottom: 85px;
    padding-left: 80px;
}

Try it

Shorthand Property of Padding by 1 values in CSS

div {
    border: 5px solid purple;
     padding: 50px;
    background-color: lightpink;
}

Try it

Shorthand Property of Padding by 2 values in CSS

div {
    border: 5px solid purple;
     padding: 20px 30px;
    background-color: lightpink;
}

Try it

Shorthand Property of Padding by 3 values in CSS

div {
    border: 7px solid red;
    padding: 50px 75px 100px;
    background-color: lightgray;
}

Try it

Shorthand Property of Padding by 4 values in CSS

div {
    border: 7px solid purple;
    padding: 30px 60px 90px 120px;
    background-color: pink;
}

Try it

 

 

Exit mobile version