Monday, 5 June 2017

Working With the padding-left Property

The padding-left property sets the padding to the left of an element. This means adding space between the content of an element and its left border. Negative values are also allowed in this property.

The syntax used to set the padding -left property is:

padding-left:value;

Let's create a Web page named paddingleft.html which is used to display the padding-left property.

<!doctype html>
<head>
<title> padding-left property</title>
<style type="text/css">
p.padding{padding-left:4cm;}
p.padding2{padding-left:25%}
</style>
</head>
<body>
<p class="padding">This is a example of paragraph with padding 2cm</p>
<p class="padding2">This is aexample of paragraph with padding 25%</p>
</body>
</html>


The Output of the Above Web page :



No comments:

Post a Comment