6. Block Elements

The elements listed in the summary below are parent elements, meaning they often contain child elements, not all of which are listed here. Note that obsolete elements used before HTML5 aren’t included, even though modern browsers often accept them. A huge amount of extra information about the workings of elements can be found online, although some of it may be out of date.

address article aside ​audio blockquote canvas details dialog div dl figure footer form h1 h2 h3 h4 h5 h6 header hr iframe main menu nav noscript ol p pre section table ul video

Fortunately, although understanding these elements is useful, you don’t need them all to create a fully compliant and working web page. In fact, many simple pages only use div and p.

Divisions

The following elements can be used to divide a page up into its constituent areas:

Of these, div is most frequently used, often with multiple div elements nested within other div elements. However, unlike the others listed here, div doesn’t suggest the purpose of the block. Instead it indicates an area whose styling is defined in a linked stylesheet. Wherever possible, it’s better to replace div by a semantic element, such as header, which gives some meaning for a specific part of the page, a feature that’s useful for both designers and search engines.

Headings

Elements h1 through to h6 are for headings in ever-decreasing sizes. Where possible, use them in order, without gaps. The relative sizes of the text used for each can be adjusted in a stylesheet.

Lists

The following types of list can be used:

A definition list contains the name of each definition (term), followed by the actual definition of that term. Using a stylesheet, an ordered list can be provided with numbers or letters at the beginning of each entry, whilst an unordered list can incorporate bullets or other symbols.

Tables

A table element typically contains the following:

Tables can be complex to construct, but the thead, tbody and tfoot elements allow the body of a table to be scrolled independently of the head and foot.

Media

Audio and video content can be included in a web page. The following elements can be used to include such material, with a controller bar or other options:

Interactive Elements

These elements allow a user to interact with a site, permitting them to view additional material or to enter their own information. Some of these features are not available in certain browsers.

Other Block Elements