How to select child element using parent element id in CSS? can i select like this?
#intro p {
color: red;
}
<div id="intro">
<p>Lorem ipsum dolor sit amet</p>
</div>
CodePudding user response:
That works fine. If you want to select direct children, you can use:
#intro > p {
color: red;
}