Lowercase your darlings
Personally, I’ve always disliked uppercase tags in the code. Uppercase characters in digital format is often perceived as screaming, and if that’s true, boy, have I’ve been screamed at by a lot of code I’ve seen. It looks bulky and feels like working with skyscrapers when doing a cut-and-paste operation, one expects the computer to start screaming from the effort.
Estethics aside, there’s also a good technical reason for not using uppercase tags: it’s not allowed in any flavor of XHTML. To quote the XHTML 1.0 specification:
XHTML documents must use lower case for all HTML element and attribute names
As a follow-up to this, if your XHTML/HTML is indeed lowercase, make sure that your tag-specific rules in your CSS is lowercase too. Otherwise, you might not get the behavior you expect (you will not get it to work with lowercase XHTML tags and uppercase references in your CSS, if it’s sent with the MIME type application/xhtml+xml).
So, if you like and use uppercase tags, please lowercase your darlings. For me, and for the future.

12 Comments/Reactions
July 18th, 2005 at 9:53
There is one exception though, the doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">July 18th, 2005 at 10:13
Jens,
Absolutely, the doctype being the exception.
Previously, I thought it was optional to write a doctype in uppercase (but lowercase was fine too), but after doing some reading it seems like a necessity to have it uppercase.
Anyone who can shed any light on this?
July 18th, 2005 at 11:39
lowercase is so much more fun let’s get rid of punctuation as well doesn’t that sound like a good idea
Nah, seriously, I love lowercase for code. Sooo much nicer!
July 18th, 2005 at 11:53
Faruk,
Punctuation is overrated…
July 18th, 2005 at 13:17
The <!DOCTYPE > uses a fixed, uppercase, format by definition (rule 28 in fact
)in the XML recommendation – http://www.w3.org/TR/2004/REC-xml-20040204/#NT-doctypedecl
So does the PUBLIC and SYSTEM identifiers – http://www.w3.org/TR/2004/REC-xml-20040204/#sec-external-ent
In XHTML, the root element – html – is specified using lowercase, and as a consequence, the root element part (i.e. “html”) must be lowercase in XHTML doctypes (XML being case sensitive).
July 18th, 2005 at 13:44
Jarvklo,
Thank you, what would I do without you?
July 18th, 2005 at 15:40
The DOCTYPE is not an element. What’s all the fuss about?
July 18th, 2005 at 15:57
Anne,
Of course you’re right!
But I think it’s good that it was pointed out, to avoid the risk of people starting to lowercase that too.
December 30th, 2005 at 13:33
in html, the word “DOCTYPE” doctype can be in lowercase.
only the formal public identifierâ€â€the quoted string that appears after the PUBLIC keywordâ€â€is case sensitive.
http://www.w3.org/Bugs/Public/show_bug.cgi?id=24
\- p
December 30th, 2005 at 14:38
Paul,
Thanks for clearing that up!
March 1st, 2006 at 20:46
I’ve notice that the search engines are returning and spidering my website multiple times for different case use. i.e. I’d get hits for zyx.com/content and Zyx.com/Content
Silvio
March 2nd, 2006 at 8:39
Dubai Ski,
Hmm, interesting.
Write a comment
Twitter reactions