From the Belly of the Beasts Archives, page 4

The posts in this category originally appeared on From the Belly of the Beasts between May 2005 and June 2006, my contribution to a group blog run by O’Reilly’s now-defunct Online Production Group.

HTML Tag of the Day: q

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:

Visual user agents must ensure that the content of the Q element is rendered with delimiting quotation marks. Authors should not put quotation marks at the beginning and end of the content of a Q element.

I’ve marked up the passage above using <blockquote>s. Here’s how it looks marked up with <q> tags: Visual user agents must ensure that the content of the Q element is rendered with delimiting quotation marks. Authors should not put quotation marks at the beginning and end of the content of a Q element.

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.

q:before {
  content: open-quote;
}
q:after {
  content: close-quote;
}

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.

There are only 10 legal XHTML empty tags

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:

All elements other than those declared in the DTD as EMPTY must have an end tag. Elements that are declared in the DTD as EMPTY can have an end tag or can use empty element shorthand.

A quick search for “empty” on the XHTML 1.0 DTD returns the following list of tags that can legally use the empty element shorthand:

Note: <a/> and <script/> are not on that list.

This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.

View Source in Tab Bookmarklet

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.

View Source in Tab

Now if only I could associate a keyboard shortcut (thinking Ctrl+U) with this function, I’d be golden.

This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.

As seen in the O’Reilly parking lot

FSM on a Caddy:

fsm-caddy.jpg

Sweet!

This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.

Uncool URLs

I don’t understand why the iTunes RSS extension spec (you know, the one you get when you google for itunes rss) hasn’t been updated since July 2005:

http://phobos.apple.com/static/iTunesRSS.html

But if you want the latest version (as of October 2005) it’s buried in an archive of an Apple mailing list:

http://lists.apple.com/archives/syndication-dev/2005/Nov/msg00002.html

…that I wouldn’t have known about if I wasn’t on the feedvalidator mailing list.

This post first appeared on From the Belly of the Beasts, a weblog from some of the people who build O’Reilly websites.