IRISM's WebZine

Skip to main content

Using Markup Properly

Hn Tags

Markup tags should be used to give a document structure that makes sense. For most Web pages, the "sense" is hierarchial. This is why markup tags, particularly heading tags (<h1>, etc.) should be in a hierarchial sequence.

<h1> should be used for the site identifier header. The contents can be created with text characters included in the HTML, like

The Site Header

or can be created as an image:

The Site Header

<h2> should be used to identify the page header or page title. For complex sites, <h2> could be used to identify a section of the site.

If <h2> is used to identify a page, then <h3> can be used to identify topics on the page. If <h2> is used to identify a section of the site, then <h3> can be used to identify the page header or page title.

One should minimize the levels of <hn> tags, because that makes the page more complicated. If the page is a long content-filled text document, that usage may make sense. Otherwise, keep the levels down to no more than four or five (<h1> - <h4> or <h5>).

Lists

What is a list? With a clear understanding of the answer, one can then understand when and how to implement lists.

All lists must have at least one element. The W3C HTML validator will spew out an error if the combination <ul> </ul> is used without at least one <li> tag between them. Some accessibility evaluators (e.g., A-prompt), require at least two items in the list (a list has to have more than one element to be a "list" of things).

Sometimes, the document would be organized better if it is restructured use <hn> tags instead of using list items.

Blockquotes and Quotes

Blockquotes (<blockquote>) and quotes (<q>) are nothing more than quoted text. Blockquotes are multiple lines of text, while quotes are single lines of text. Neither of them, under the W3C's HTML 4 guidelines, can allow other formatting within them. Unfortunately, that means one cannot emphasize or strongly state a portion of the quote, something that is quite reasonable in normal life.

Blockquotes are not supposed to be used for indenting blocks of text; this should be done by using styles.

Currently, it appears that some user agents do not know what to do with quotes (<q>). Internet Explorer does not put down any default quotes. Dreamweaver has no style definition categories for quotes. Other editing packages do not even recognize the <q> tag. To have quotes show up at this time seems to require that a &quot; be hard-coded into the HTML itself.

In any case, the determination of whether something is quoted should be evident from the surrounding context.

Horizontal Rules

I like them. Some people say they are horrible. It depends on how they are used. For example, they could be used as graphical elements, which is fine. Or, they could be used to separate sections of the page; however, the only usage of a horizontal rule for that reason would be to separate bottom address and copyright information. Otherwise, it is better to separate sections by using header markup and white space. This makes the page less cluttered. Less cluttered means more visually appealing.