Child
A child combinator in CSS is the “greater than” symbol, it looks like this:
ol > li {
color: red;
}
It means “select elements that are direct descendants only”. In this case: “select list items that are direct descendants …
The ::before
and ::after
pseudo-elements in CSS allows you to insert content onto a page without it needing to be in the HTML. While the end result is not actually in the DOM, it appears on the page as if …
There are lots of ways you can select elements in CSS. The most basic selection is by tag name, like p { }
. Almost anything more specific than a tag selector uses attributes — class
and ID
both select …
The adjacent sibling combinator in CSS isn’t a selector on its own, but a way of combining two selectors. For example:
p + p {
margin: 0;
}
The plus sign (+) is the adjacent sibling combinator, between two paragraph …