Hello, i am a beginner in this field and i have joined the Responsive Web Design course to learn about HTML and CSS. Right now im in Learn basic CSS by building a cafe menu and so far i have understood everything that i’ve been taught except for this one thing (sorry if i can’t manage to make myself explain my doubt well enough beforehand).
Why does this Class in CSS has a p after it when the other classes does not?
in css, we create selectors to target different elements in the html.
There are multiple ways to target elements.
One way is when we want to target all descendants of a specific element.
In this case we have
.item p
which means i want to select all p elements nested within any .item element.
If I just wanted p elements in general I wouldn’t need the .item in front.
So the way this is written has a special meaning.
You will learn more css selectors as you progress.