Skip to content

HTML Basics: Write Your First Web Page (Free Lesson with Live Editor)

NeedMyTools Academy

Sign in free to read the full lesson

Sign in or create a free account

Free forever. No card, no paywall.

Every website you have ever opened, from a government portal to a shop, is built on HTML. HTML (HyperText Markup Language) is not a programming language: it does not calculate anything. It describes what each part of a page is, such as a heading, a paragraph, a link or an image, so the browser knows how to show it and search engines and screen readers know what it means. In this lesson you write a complete page and see it appear as you type.

Quick answer

An HTML page is a text file of elements. Each element is usually an opening tag, content and a closing tag, like <p>Hello</p>. A full page starts with <!DOCTYPE html>, then an <html> element holding a <head> (information about the page, such as its title) and a <body> (everything the visitor sees).

15 min read and practice · Content checked on 20 October 2026

In this lesson you will

  • Explain what HTML does and what it does not do
  • Write a valid page skeleton from memory
  • Tell elements, tags and attributes apart

Elements, tags and attributes

A tag is the text in angle brackets. <p> opens a paragraph and </p> closes it; the closing tag has a slash. The opening tag, the content and the closing tag together make an element. Elements can sit inside other elements, which is called nesting: <p>This is <strong>important</strong>.</p> puts a strong element inside a paragraph.

Some elements have no content and no closing tag. They are called void elements; <br> (a line break), <img> (an image) and <meta> are common ones. You may see them written as <br /> in older code: the slash is allowed but does nothing in HTML.

Attributes add extra information to an element. They go inside the opening tag as name="value". For example <a href="https://needmytools.com"> tells a link where to go, and <html lang="en"> tells the browser the page is in English. Always put attribute values in quotes; it avoids bugs when a value contains a space.

Try it: Elements, nesting and an attribute
Code
ResultUpdates as you type
Console
  1. Console messages, errors, form data and clicked links appear here.

Change the text between the tags and watch the result update. Clicking the link in the preview is logged in the console instead of leaving the page.

Sign in free to read the full lesson

You are reading the free preview. Create a free account (it takes one minute, no password) to unlock the rest of this lesson and track your progress.

Unlocks after sign-in:

  • 2 more sections with live code examples
  • Common mistakes to avoid
  • Hands-on coding exercise with automatic checks
  • Practice quiz and the graded lesson test
Sign in or create a free account

Free forever. No card, no paywall.

Questions people ask

Is HTML a programming language?

No. HTML is a markup language: it labels content but has no variables, conditions or loops. You add logic with JavaScript, and many people still call writing HTML "coding" in everyday speech.

What software do I need to start writing HTML?

Only a browser and a text editor. The editor on this page is enough to learn. When you work on files, free editors such as Visual Studio Code add colour, autocomplete and error hints.

Are HTML tags case-sensitive?

No, <P> and <p> work the same in HTML. Lowercase is the common convention and is what most style guides and tools expect, so use lowercase.

What is the difference between HTML and HTML5?

HTML5 was the name of a major version. Today HTML is a "living standard" maintained by WHATWG and updated continuously, so there is no HTML6 to wait for. When people say HTML5 they usually mean modern HTML.

How long does it take to learn HTML?

The basics in this course take a few evenings: about two hours of reading plus practice. Writing clean, accessible HTML well takes longer and comes from building real pages, which is what the exercises are for.

Sources

Facts in this lesson were checked against these official pages on 20 October 2026.

Code examples stay in English and run in a sandbox on your device. If you spot a mistake, tell us through the contact page.