XHTML 5 Reference

go to previous section go to next section

General Formatting

The following tags can also appear anywhere within the body of your page to semantically identify the content. Note that in some cases the semantic meaning in XHTML 5 is different from that in XHTML 1.0. These changes to meaning have been made to make the tags more flexible in their use and also to more accurately reflect how they are actually used.

Commenting your source

Comments can be placed anywhere within an HTML document except within the other tags used to markup the document. All comments begin with <!-- and end with -->. The XHTML specification states that the content of comment fields should be ignored so you should not wrap any in page scripts or styles inside comments.


The basic unit of text within a document is the paragraph. Each paragraph within the document should be contained between the following tags <p> </p>. Note that the XHTML standard requires all end tags to be specified.


There are six different heading levels that can be used to place headings within your document. The heading should be placed between the appropriate pair of tags from the following:

The numbers represent the relative importance of the headings. Exactly how the headings will be displayed depends on how you style them.

Other section breaks

The following tags allow you to split your document up into sections which can be formatted and manipulated differently from the other sections of your document. Unlike the new ones mentioned on the previous page, these have no specific semantic meaning and are to be used where there is no more semantic tag available.

Semantic Inline Tags

While all of the tags in your XHTML should semantically define what they contain, the following tags are used only because of their semantic meaning as they do not create a block that can be styled.

Line Breaks

The following tags and tag pairs manipulate the position that text appears on the page.


These elements provide wrappers to group images, code etc that are related and also to associate them with their corresponding captions.

<figure> </figure> This element can thus be used to annotate illustrations, diagrams, photos, code listings, etc.

<figcaption> </figcaption> used within a figure to apply a caption to the images within the figure.

Date and Time

<date value=""> </date> and <time datetime=""> </time> wrap around a visitor readable date or time while providing a machine readable equivalent in the provided attribute.


<canvas width="" height=""> </canvas> provides a drawing space on the page that can be drawn in using special JavaScript commands.

New or Removed

You can indicate new or removed text on your page using the following tags.

The following optional attributes can be specified on an <ins> or <del> tag in addition to the ones that can be included on any tag:

Other format types

The <bdo dir=""> </bdo> tags surround text in foreign languages so that the direction of the text can be indicated to the browser. Direction can be LTR (left to right) or RTL (right to left).

go to previous section go to next section


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow