I got stuck when designing a dynamic page of news today when I added a heading tag at the beginning of my section and the first-child of a p tag inside a div stopped working. This is what I was trying to do and it was working until I add the heading tag.
.pubs .newsdate {
border-top:1px solid rgb(255,179,0);
}
.pubs:first-child .newsdate {
border:none;
}
<section class="content">
<h2>News</h2> //issue
<div class="pubs">
<p class="newsdate">stuff</p>
</div>
<div class="pubs">
<p class="newsdate">stuff</p>
</div>
<div class="pubs">
<p class="newsdate">stuff</p>
</div>
</section>
The first border was being removed properly until I added the heading (h2) tag. Then, the pseudo selector stopped working. What could have happened?