Grokking CSS for Web Development
0% completed
Child combinator (>)
Compare .post p with .post > p on the trail page from the previous lesson. The first matches four paragraphs. The second matches three, because it skips the paragraph inside the tip box.
An element placed directly inside another element, with nothing in between, is that element's child. The child combinator, a greater-than sign, matches only children. The selector .post > p reads as "a p element whose parent has the class post".
.post > p { color: darkred; font-weight: bold; }
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%