Monday, August 19, 2013

CSS padding individual sides

<html>
<head>
<style type="text/css">
p
{
background-color:green;
}
p.padding
{
padding-top:25px;
padding-bottom:25px;
padding-right:50px;
padding-left:50px;
}
</style>
</head>

<body>
<p>This is a paragraph with no specified padding.</p>
<p class="padding">This is a paragraph with specified paddings.</p>
</body>

</html>

Result


No comments: