Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

selectors are very powerful

generally speaking, selectors can be combined to create more and more selective ones;
for example


pseudo-class selectors


to get it right, we can use the other pseudo-class :link
that is set only on <a> tags that have a href= attribute

Loading...

rank of element amongst its siblings


nth-child() example

Loading...

pseudo-class selectors (continued)


selecting X under Y (optional)

div p
matches all <p> elements that are below a <div> element at any depth

div>p
matches all <p> elements that are an immediate child of <div> element

Loading...

selecting X as a sibling of Y (optional)

div + p
matches all <p> elements that are immediate right sibling of a <div> element

div ~ p
matches all <p> elements that are some right sibling of a <div> element

Loading...

attribute selectors (advanced)