Can somebody please explain, what is the inherit keyword meant to do in CSS?
It will use the same value as the same property his parent has.
html:
<body>
<h1></h1>
</body>
css:
body{
margin: 234px;
}
h1{
margin: inherit; #=234px
}
Note to this if there are multiple instances of <h1>
in the file, it will take the margin of it's parent. So 234px is not always the value it will have. For example
html:
<body>
<h2></h2>
<div>
<h2></h2>
</div>
</body>
css:
body{
margin: 20px;
}
div{
margin: 30px;
}
h2{
margin: inherit; #20px if parent is body; 30px if parent is div
}