#myId {
}
[pattern*="\d"] {
}CSS selector structure / notebook
CSS selector structure
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
a#selected {
}
[type="checkbox"]:checked:focus {
}a#selected > .icon {
}
.box h2 + p {
}#main,
article.heading {
}#main,
:bad-pseudoclass,
.validClass {
/* `:bad-pseudoclass` is invalid, invalidating this style block */
}:has(+ div#topic > #reference) {
}
:has(> .icon) {
}
dt:has(+ img) ~ dd {
}