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
Differentiate between the Font-weight and Font-variant properties.
Explain the purpose of using the shorthand Margin property.
Identify the errors in the codes below and write the correct code:
import url (style_imp.css)
<STYLE> p{color:808080} </STYLE>
<p style= "text:align: justify">
P {font: arial 15px sans-serif;}
{p-color:red;}
Harsh is working on a client's project which requires him to add a picture on the top left part of the web page. While adding the picture, Harsh realised that the picture is being repeated multiple times. Suggest the property and its value to Harsh that can be used to stop the image from getting repeated.