Other answers have pointed to the problem of using a numeric ID. They are right in theory, but in practice all modern browsers support numeric IDs. So, for example, getElementById('88')
will work.
The problem lies not with the HTML, but with the CSS. CSS has the notion of CSS identifiers, which is not identical to the rules for HTML IDs. A rule using an invalid CSS identifier as an ID (#88
) is invalid and therefore ignored. This is not because it is an invalid HTML ID; it is because it is an invalid CSS identifier.
Therefore, as @Manoj Kumar correctly pointed out, you can get around this problem by escaping the ID in the form #\38\38
.
This same trick could be used in the case of a classname containing a colon. You might say, that's invalid. Technically it may be so, but it works fine in HTML. The problem is how to escape the colon; in this case, you can do it with a single backslash, as in a\:b
.
The other confusing thing about your example is that you are using the content
property with a selector which is not either a ::before
or ::after
pseudo-selector. That's also "invalid". You should fix it. I would by no means rely on this working on all browsers. However, it works, as it turns out, at least in Chrome (but not in FF, for example).
Similarly, the syntax for the value you are giving to the content
property is not valid. Correct values include strings, or the attr()
syntax. So you should also fix this. It's non-standard. It works only by accident. You should use background-image
instead.