CSS Padding Property

In this chapter you will learn:
About padding property
Syntax of this property
Values of this property
Example of this property

CSS padding property is used to specify the space is inside the border of the element. You can clear space between border and content of the element. This property provides options to clear space of left, right, top and bottom of the element but the condition is that it can only work inside the element border.

Syntax of this property-
padding-left:value;
padding-right:value;
padding-top:value;
padding-bottom:value;
Values of this property-
length- Used to specify fixed padding in px, pt, cm, em etc.
%- Used to specify padding in % (percent)

Example of this property

<html>
<head>
    <title>Example of padding property</title>
    <style type="text/css">
     div
     {
     width:400px;
     background-color:Aqua;
     padding-left:50px;
     padding-right:100px;
     padding-top:80px;
     padding-bottom:30px;
     }          
    </style>
    </head>
<body>
<div> This is the example of padding property of css.<br/>
</div>
</body>
</html>

Output:-
example of padding property
SUMMARY

In this chapter you have learned about padding property so now click on Next button to know more properties of CSS.

 

Share your thought