The following example lets the left margin be inherited from the parent element.
Html Code:
<!DOCTYPE html>
<html>
<head>
<style>
div.container {
border: 1px solid red;
margin-left: 100px;
}
p.one {
margin-left: inherit;
}
</style>
</head>
<body>
<h2>Use of the inherit Value</h2>
<p>Let the left margin be inherited from the parent element:</p>
<div class="container">
<p class="one">This is a paragraph with an inherited left margin (from the div element).</p>
</div>
</body>
</html>
Post a Comment