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

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -