Go Back

HTML Section 5

HTML5

The latest version of HTML is HTML5.

Inline vs Block Elements

These are terms used to classify elements based on how they are displayed. For example, heading and paragraph elements take up the full width and appear on their own line—these are called block elements. In contrast, anchor and image tags do not break the flow and appear within a line—these are called inline elements.

Example of Block Elements

Another Block Element

This is a paragraph (block)

This is a link (inline)

Spans and Divs

Both <div> and <span> are container elements.


Some Quick Elements

hr

Creates a horizontal line and does not have a closing tag.

br

Breaks the line and moves the content to the next line.

sup / sub

Superscript: 2nd
Subscript: H2O

HTML Entities

Entities are used to display reserved or special characters in HTML. They begin with & and end with ;.

List of HTML Entities

Example: ©

Semantic Markup

Semantic elements describe the meaning or purpose of the content, making the code more readable and accessible. The following tags are like <div> but have specific roles:

Go to Section 3