gareth.fyi/2024/12/04/a...
gareth.fyi/2024/12/04/a...
[id="123"] {
color: red;
}
[id="123"] {
color: red;
}
Since HTML5, element IDs can start with numbers. But in the CSS selectors spec, and therefore in `document.querySelector`, identifiers *can't*. So how do you target an element with a numeric ID?
<div id="123">Hello</div>
#123 { color: red } /* No */
Since HTML5, element IDs can start with numbers. But in the CSS selectors spec, and therefore in `document.querySelector`, identifiers *can't*. So how do you target an element with a numeric ID?
<div id="123">Hello</div>
#123 { color: red } /* No */