Ways of implementing padding or border

what are the ways we can input padding for all sides?

There are several ways to add padding
shorthand property
padding: 10px;
it will add padding of 10px to all sides,
padding : 20px 15px;
it will add padding of 20px to top and bottom and 15px padding to left and right;
if you want to add padding to only one side you can use
padding-top:10px;
padding-bottom:20px;
padding-left:15px;
padding-right:15px;

or you can do also like this
padding : 10px 15px 20px 15px;

1 Like

Padding:

1.If we want to apply the different padding to all the four sides (top, bottom, left, right), then we have to specify the four values in the padding property.

padding: 10px 50px 75px 200px;

2.If we specify the two values, then the Html editor applies the first padding to the top and bottom and second padding to the left and right.

padding: 100px 50px;

3.If we specify only value in the padding attribute, then the Html editor apply the same padding to all the four sides.

padding: 100px;

4.Following are the five different properties from which we can apply the padding on each side:

i. Padding-left:

If we want to apply only left padding to an element, then we have to use only padding-left property

padding-left: 75px;

ii. Padding-right:

If we want to apply only right padding to an element, then we have to use only padding-right property

padding-right: 250px;

iii. Padding Top:
If we want to apply only top padding to an element, then we have to use only padding-top property

padding-top: 25px;

iv. Padding Bottom:

If we want to apply only bottom padding to an element, then we have to use only padding-bottom property

padding-bottom: 250px;