I would like to set the margin-bottom value of the default element.
Consider the following example, in which there are h1 elements that have the corresponding margin-bottom style properties specified as 0:
h1 { border: 1px solid red; margin-bottom: 0; } p { margin: 0; }
<h1>First Heading</h1> <p>Paragraph</p> <h1 id="normal-margin">Second Heading</h1> <p>Paragraph</p>
How can I reset the bottom value of the #normal-margin field to indicate its initial default value? Obviously, using initial will not work, since the initial margin-bottom value is 0 .
In this trivial example, I can simply add :not(#normal-margin) to the h1 style definition to fix the problem. Nevertheless, I would like to find a solution that will βcancelβ the margin and reset to its initial value.
Im thinking that Im will have hardcodes in CSS, which seems a little cheap to me. Is this the only solution to this problem?
html css
Jack greenhill
source share