HTML Essentials

HTML Tags

Understand how tag names identify different kinds of content.

An HTML tag is the marker that tells a browser which element you are creating. A meaningful tag makes the role of its content clear.

Choosing a tag

Choose h1 for the main topic, p for prose, a for a link, and button for an action.

Important definitions

Tag name
The word immediately after the opening angle bracket.
Start tag
The marker that begins most elements.
End tag
The matching marker that begins with a slash.

Syntax

Use this general pattern as a reference:

HTML
<tagname>content</tagname>

Examples

HTML Tags worked example

EXAMPLE 1
<article>
  <h2>Update</h2>
  <p>The lesson is ready.</p>
</article>
ResultAn Update article containing a heading and paragraph.
Try it yourself

Expected output

An Update article containing a heading and paragraph.

Note

Tags are not case-sensitive in HTML, but lowercase is the common convention.

Tip

Choose tags by meaning rather than their default appearance.

Common mistakes

  • Inventing tag names without creating web components.
  • Using one tag for every kind of content.
  • Mismatching opening and closing tag names.