My h1
tag is not getting styles of my css.
<h1 class=123>ExampleText</h1>
I targetted this is and it still doesn't allow me to change the properties of the h1
tag.
My h1
tag is not getting styles of my css.
<h1 class=123>ExampleText</h1>
I targetted this is and it still doesn't allow me to change the properties of the h1
tag.
This is simply a invalid CSS class because a CSS class selector can't start with a number
From w3C specs
In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-z0-9] and ISO 10646 characters +00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F".
So nothing related to missing quotes, as others mentioned. Because as @Quentin explained very well in a comment:
Quotes are only required if the value contains certain characters, and that example contains none of them
See this example:
h1 {
width: 50px;
height: 50px;
border: 1px dashed blue;
float: left
}
.123 {
background: red
}
.n123 {
background: lightgreen
}
<h1 class=123></h1>
<h1 class=n123></h1>
<h1 class="123"></h1>
<h1 class="n123"></h1>