Introduction to HTML

HTML — HyperText Markup Language — is the language every web page is written in. It describes what content a page contains and what each piece is: this is a heading, this is a paragraph, this is a link, this is a form. Browsers read HTML and turn it into the pages you see.

What HTML does

HTML wraps content in tags that give it meaning. Here's a tiny page — edit the text in the editor and watch the result update:

Try it yourself
Result

Without tags, the browser would show one long line of text. With them, it knows that "My Recipe Blog" is the main heading, the ingredients form a list, and the last line is a link.

HTML, CSS and JavaScript

Web pages are built from three languages that work together:

LanguageJobAnalogy
HTMLStructure and meaning of the contentThe walls and rooms of a house
CSSAppearance: colours, fonts, layoutPaint and furniture
JavaScriptBehaviour and interactivityElectricity and plumbing

HTML always comes first. A page with only HTML is plain but completely usable — which is exactly how screen readers, search engines and slow connections experience the web.

Markup, not programming

HTML isn't a programming language: it has no variables, loops or calculations. It's a markup language — a way of annotating content. That makes it the gentlest place to start learning web development, and something every web developer uses every day regardless of their framework.

A complete page

Real HTML files have a standard outer structure. You'll learn every line of this in lesson 03:

Try it yourself
Result

How a browser shows a page

  1. The browser downloads the HTML file from a server (or opens it from your computer).
  2. It parses the tags into a tree of objects called the DOM (Document Object Model).
  3. It fetches any CSS, images and scripts the page refers to.
  4. It works out the layout and paints the page on screen.

Browsers are very forgiving: if your HTML has a mistake, they make a best guess rather than refusing to show the page. That's friendly, but it means mistakes can go unnoticed — lesson 46 shows how to validate your HTML.

A brief history

HTML was created by Tim Berners-Lee in 1991 at CERN. Today it's a "living standard" maintained by WHATWG, a group including the major browser makers, and updated continuously rather than in numbered versions. People still say "HTML5" to mean modern HTML, which added elements like <video>, <nav> and <canvas>.

How this course works

  • Try it yourself editors show a live preview — type in the code and the result updates as you go.
  • Every example has been checked with an HTML validator.
  • Practise with the exercises, test yourself with the quiz, and finish by building a portfolio page in lesson 48.
Tip: right-click any web page and choose View Page Source (or press Ctrl+U) to see its HTML. Doing this on sites you like is one of the best ways to learn.