HTML Guide

HTML Basics: Your First Tags, Explained

Every web page, no matter how complex, is built from the same handful of tags. Here's what they mean and how they fit together — no prior coding experience needed.

Tags come in pairs

Most HTML tags wrap around content with an opening tag and a matching closing tag (the closing one has a forward slash):

<h1>Welcome</h1>

This creates a top-level heading containing the text "Welcome." Everything between <h1> and </h1> is what gets displayed as that heading.

Headings: h1 through h6

HTML has six heading levels, from <h1> (the most important, usually the page title) down to <h6>. A page should have exactly one <h1> — using the right heading level for the right content matters both for readability and for search engines.

Links: the anchor tag

A clickable link uses the anchor tag <a>, with the destination in an href attribute:

<a href="https://example.com">Visit Example</a>

The text between the tags ("Visit Example") is what's visible and clickable; the href attribute is where clicking it goes.

Form inputs

Collecting information from a user — an email address, a name — uses the <input> tag. Its type attribute changes both its behavior and its built-in validation:

<input type="email" name="email" /> <input type="text" name="fullname" />

type="email" gives you free format checking (a browser will flag "not-an-email" before the form even submits) that plain text inputs don't have.

Note: <input> is one of a handful of "self-closing" tags — it doesn't wrap around content, so it has no separate closing tag, and gets written as <input /> or just <input>.

Try it yourself

Practice writing real HTML tags with instant feedback.

Start practicing HTML →