18 August 2007

HTML tag of the day: VAR

It's amazing what you discover when reading another site's style guide: the HTML VAR tag.

The specification suggests using it to mark up 'an instance of a variable or program argument'. Here's an example:

This macro requires the <var>count</var> parameter, which specifies how many items to display.

By default in most browsers, the contents of the <var> tag will render as italic text:

This macro requires the count parameter, which specifies how many items to display.

This seems like a really useful tag to me, especially for technical documentation. Fortunately, it isn't one of those tags on the chopping block to be removed in HTML 5.