CBSE Class 10 Computer Applications Question 55 of 56

Cascading Style Sheets (CSS) — Question 9

Back to all questions
9
Question

Question 9

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

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;
}