footer.p vs “footer p” selector?
I’ve html code like this:
<footer><p>Copyright ©2027 by The Code Magazine</p></footer>
I want to select it.
CSS:
footer p{
font-size:16px;
}
But footer.p isn’t working. “footer p” works though. Why is footer.p not working? I’ve seen div.p selector being used in lots of places.
Descendant selector:
It selects all descendants of an ancestor. In this case, all p inside footer.