In this tutorial:


Block-level / Inline Elements

HTML elements are usually either "block-level" elements or "inline" elements. A block-level element occupies the entire space of its parent element (container), thereby creating a "block."
Browsers typically display the block-level element with a newline both before and after the element.

Differences between block-level elements and inline elements:

The <p> element is a block-level element, while <b> element is an inline element.

Examples of the block-level elements are p, h1-h6, table, ul, ...

The full block-level element list can be found in MDN block-level elements.

Note: we can change elements presentation in CSS. We can change block element to be inline and via versa in CSS. This is useful for example for images, links, ...


P / DIV / SPAN

HTML is all about applying meaning to content. Whereas most HTML tags apply meaning (p makes a paragraph, h1 makes a heading etc.), the <span> and <div> elements apply no meaning at all. They are used quite extensively in conjunction with CSS. They are used to group together a chunk of HTML and hook some information onto that chunk in CSS.

Note: where it is possible, use other elements than div and span.


HTML5 Semantics Elements

HTML5 introduces a number of elements used for grouping blocks of code together and adding meaning at the same time. Some of them are described below. Examine your content and document structure to determine which of the new elements work with your page:

Page Layout Examples

# #


How to Choose an Element

HTML5 Doctor has a flow chart to help you choose the right HTML5 structural elements.

See HTML5 Element Flowchart.


Site Examples

The following are educational site examples. Pay attention to semantic elements.