demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

More HTML Text Elements

There are other tags that can be used to format text, a limited sample of which are given below. Note again that these describe what the content between the opening closing tags is; what it looks like is immaterial, in this context.

<code>
specifies that a line of text is code
<dfn>
specifies that a word is defined inline (to be useful, the opening den tag requires a title attribute with its value set to the definition of the term)
<acronym>
specifies that the word is an acronym; the same requirements as den above
<abbr>
specifies that the word is an abbreviation; same requirements
<del>
defines deleted text
<q>
defines a short quotation
<sup>
defines superscript text, such as for a footnote
<sub>
defines subscript text

Finally, note that all of these tags must be nested inside another that provides a context for the block of text as a whole: typically <p>, although there are many other possibilities.

Feel free to experiment with the above, but try to use them in the context of real-world examples – i.e. find a short quotation from a book and use the <q> tag around it, rather than using elements to “see what they look like”.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.