0

I'm trying to use this to color a grid a curtain color and it doesn't work, I'm not sure why. I think its possibly a formatting issue or if its clashing with something else I have written on my program.

#1a,
#1b,
#1c,
#1d,
#1e,
#2a,
#2b,
#2c,
#2d,
#2e,
#3a,
#3b,
#3c,
#3d,
#3e,
#4a,
#4b,
#4c,
#4d,
#4e,
#5a,
#5b,
#5c,
#5d,
#5e {
  color: darkblue;
  background-color: darkblue;
}
mplungjan
  • 169,008
  • 28
  • 173
  • 236

1 Answers1

1

This is just a basic but very common CSS mistake, you see you cannot have IDs or classes that begin with a number, just update those and it's that simple.

I also recommend you to use SASS as with a loop you'll be able to generate that kind of sequential CSS quite easy: https://stackoverflow.com/a/19088399/3362991

Please take your time to read through the CSS W3C Spec: w3.org/TR/CSS21/syndata.html#characters

In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, 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".

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Esteban Rocha
  • 160
  • 1
  • 9