I've created a website with the following HTML code:
<article>
<p>Header</p>
<p>Some content</p>
</article>
My goal is to make the 'header' text appear in bold. To achieve this, I referred to W3Schools for guidance on CSS selectors and found the following information:
:first-child - Selects every
<p>
element that is the first child of its parent
Here is my CSS:
article:first-child {
font-weight:bold;
}
However, despite implementing the above CSS, the first paragraph element (<p>
) remains unaffected. What could be causing this issue?