header - CSS: bottom margin of H2 directly after H1 -
In H1 and margin-bottom (or H2 higher margin-top) case H1 and H2 directly interchangeably So the normal margin should be applied in the # 1 case, but in case # 2, I want to change some margins (to give more "air" between H1 and H2) H1 h2 {margin ...} and h1 & Gt; Tried by h2 {margin ...} but no success yet.
Case # 1
& lt; H1 & gt; Title 1 & lt; / H1> & Lt; P & gt; Text & lt; / P & gt; & Lt; H2 & gt; Title 2 & lt; / H2 & gt; & Lt; P & gt; Text & lt; / P & gt; Episode # 2
& lt; H1 & gt; Title 1 & lt; / H1> & Lt; H2 & gt; Title 2 & lt; / H2 & gt; & Lt; P & gt; Text & lt; / P & gt;
h1 + h2 {margin: whatever; } The + selector is the adjacent selector. This will only affect components that are around the preceding element.
Comments
Post a Comment