Today’s under-utilized HTML tag of the day is the <q> tag, intended for inline quotations. The <q> tag’s oft-used block-level analog is the <blockquote>.
Interestingly enough, the HTML 4.01 spec tells us that:
If you’re looking at this post in a standards compliant browser, you’re probably seeing curly quotes around around the linked excerpt above. Unless of course you’re in France in which case you’re probably seeing angle quotation marks, aka les guillemets: « and ».
If we look at the default HTML stylesheet for Firefox (located here on Windows: C:\Program Files\Mozilla Firefox\res\html.css) we can see how Firefox adds locale-specific leading and trailing quotation marks.
Sadly IE 6 does not follow this requirement, nor does it implement the :before and :after pseudo-classes or the content: selector. Which is probably why this exceedingly useful tag has not enjoyed widespread use.
This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.
I’ve always had this nagging question. Is <a name="target"/> legal XHTML? I mean, it seems like kind of waste to have to do <a name="target"></a> all the time. Same thing with <script src="file.js"></script>, but I wasn’t sure if I could just arbitrarily use the empty element shorthand.
Turns out I can’t. There’s limited list of tags in the XHTML 1.0 DTD that can use the empty element shorthand:
Holy cow, look what I just made! Drag this bookmarket to your toolbar and use it in Firefox to toggle between the view-source: pseudo-protocol and the rendered webpage.