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.
There is one exception though, the doctype:
<code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></code>
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?
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! π
Faruk,
Punctuation is overrated… π
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-do…
So does the PUBLIC and SYSTEM identifiers – http://www.w3.org/TR/2004/REC-xml-20040204/#sec-e…
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).
Jarvklo,
Thank you, what would I do without you? π
The DOCTYPE is not an element. What's all the fuss about? π
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.
in html, the word "DOCTYPE" doctype can be in lowercase.
only the <a title="Using all lowercase letters in a DOCTYPE" href="http://www.htmlhelp.com/tools/validator/problems.html.en#doctype-case" rel="nofollow">formal public identifierâ€â€Βthe quoted string that appears after the PUBLIC keywordâ€â€Βis case sensitive.
<blockquote cite="http://www.w3.org/Bugs/Public/show_bug.cgi?id=24">the whole doctype declaration *is* case sensitive in XML, whereas in
SGML eg. the "DOCTYPE" and "PUBLIC" words are perfectly legal in
lowercase."
http://www.w3.org/Bugs/Public/show_bug.cgi?id=24
– p
Paul,
Thanks for clearing that up!
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
Dubai Ski,
Hmm, interesting.