I'm new to css and I have some auto generated snippet as following,
<div id="display">
<div>
<div>
<p>red</p>
</div>
<div>
<p>not red</p>
</div>
</div>
</div>
I have attached auto generated element into display div (first div) through javascript snippet. I want to select only first paragraph using CSS.
I tried following CSS also tried nth-child(1) ,
p:first-child {
color:red;
}
But it's selecting both of the values.