TetSharing
HTML tutorial · 12 chapters
  1. Get started
  2. Elements and attributes
  3. Headings and paragraphs
  4. Text formatting
  5. Links
  6. Images
  7. Lists
  8. Tables
  9. Forms
  10. Input types and controls
  11. Semantic layout
  12. Head and metadata

Final HTML quiz

Chapter 1 of 12 · By Ethan Cole · Updated November 21, 2026

HTML Tutorial for Beginners: Your First Web Page

HTML (HyperText Markup Language) describes the structure of a web page: this is a heading, this is a paragraph, this is a link. It is not a programming language; it has no variables or loops. CSS then controls how the page looks, and JavaScript adds behavior. Every page on the web, however complex, is HTML underneath.

Tags and elements

HTML is written with tags in angle brackets. Most come in pairs: <p> opens a paragraph and </p> closes it, with the content in between. The opening tag, content and closing tag together form an element. Elements nest inside each other like boxes, and they must close in the reverse order they opened.

The page skeleton

Every HTML document has the same outline:

  • <!DOCTYPE html> on the first line tells the browser to use modern standards mode. Without it, browsers fall back to "quirks mode", which imitates very old browsers.
  • <html lang="en"> wraps the whole page. The lang attribute tells screen readers and translation tools which language the text is in.
  • <head> holds information about the page that is not displayed in it: the character encoding and the title shown in the browser tab.
  • <body> holds everything visitors see.
HTML · editable

Expected page text

Hello, web!
This page was written by hand in HTML.

Press Run to render the page in the preview below the editor. Change the heading text and run again. Notice that the <title> text does not appear in the preview itself; in a real browser it would label the tab.

Making a page on your computer

Open any plain-text editor (VS Code is a popular free choice; avoid word processors), paste the example, and save it as index.html. Double-click the file and it opens in your browser. Edit, save and reload to see changes. That is the whole development loop for a static page.

How browsers read HTML

Browsers are forgiving: a missing closing tag or a misspelled element usually still displays something, because the HTML standard defines exactly how to recover from errors. That forgiveness hides mistakes, though, so write clean markup and check it with a validator such as the W3C one.

Common mistakes

  • Saving the file as index.html.txt. Make sure the extension is .html.
  • Putting visible content inside <head>.
  • Forgetting the doctype, which can make layouts behave strangely.

Summary

  • HTML structures content with elements made of tags.
  • A page has a doctype, then <html> containing <head> and <body>.
  • Only the body is displayed; the head describes the page.

Quiz: Get started

1. Which part of a document is displayed in the browser window?

The body holds the visible content; the head holds metadata.

2. What does <!DOCTYPE html> do?

The doctype tells the browser to render with modern standards rather than quirks mode.

3. What is HTML mainly responsible for?

HTML describes structure; CSS handles appearance and JavaScript behavior.

Official docs

Written under the pen name Ethan Cole with AI-assisted drafting. Every code example on this page is executed by our test suite before publishing. Found a mistake? Tell us.