KnowledgeBoat Logo
|

Computer Applications

How will you add padding space to all the four sides of an element?

CSS

6 Likes

Answer

We can use the Padding property to add padding space to all the four sides of an element. The syntax for Padding property is as follows:

padding-side : value;

where side = top / right / bottom / left

and value = length | percentage

For example, to add padding to a <P> element, we use the following code:

P   {
Padding-top : 20px;
Padding-right : 40px;
Padding-bottom : 20px;
Padding-left : 40px;
}

Answered By

3 Likes


Related Questions