Monday, August 19, 2013

CSS margin shorthand property

<html>
<head>
<style type="text/css">
p
{
background-color:yellow;
}
p.margin
{
margin:100px 50px;
}
</style>
</head>

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

</html>

Result


No comments: