HTML entities with ID attributes beginning with a number appear to cause an error in WordPress page templates. Such an attribute will stop all CSS from rendering on and subsequently down the cascade of the particular entity.
This may or may not be a known error—my use of the Google could not tell me definitively—but I have just found a full stop to several hours of hair-tearing, code-rewriting and server-switching frustration—WordPress (version 2.7.1) doesn’t appear to like the ID attribute of any HTML placed in a WordPress page template to have a number at the beginning.
For example:
<div id="15-reasons>Some content in here...</div>
The offending ID? “15-reasons”, a CSS ID which I was using in a small amount of HTML hard-coded into a customised WordPress page template.
Until I removed the number from the beginning of the ID:
<div id="fifteen-reasons">Some content in here...</div>
no combination of tweaks to the CSS, HTML or WordPress could explain why my page was rendering as though all CSS had been disabled.
Update
Jonathan of Pixel Acres points out that starting an ID with a number is actually invalid HTML! Which just goes to show that I have been achieving validation all these years, on this point at least, by accident rather than intention:
ID and NAME must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (”-”), underscores (”_”), colons (”:”), and periods (”.”).
I stand corrected, and better educated, and will let WordPress off the hook—this time…



Starting an ID with a number is actually invalid HTML!
ID and NAME must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (“-”), underscores (“_”), colons (“:”), and periods (“.”).
Thanks for setting me straight Jonathan, *blush*! I think this post requires an update…
I’m not sure you should let WordPress off the hook so lightly! I just noticed that when I am logged into my WP blog, the comment input element that appears beneth my posts is assigned the id _wp_unfiltered_html_comment, which is illegal because it begins with an underscore. It seems like a case of “do as I say, not as I do”.
.-= Jonathan Nicol´s last post: Reconsidering Arial =-.
I can possibly imagine WordPress saying in response, a little like Microsoft, “It’s our templating language, and we’ll follow whatever standards we want to thank you.” Oh for the day to come of an accessible, internet level playing field…
Yes you are talented
Thank you Mr Damier. Despite being a heartless robot you’re very kind.
John Gillespie´s last post: Hey WordPress- Where’d My Excerpt Go