HTML 5 min read

HTML Basics: A Beginner’s Guide to How Web Pages Work

HTML is the skeleton of every web page. Learn what tags, elements and attributes are, how a page is structured, and the handful of rules that make your HTML clean, accessible and search-friendly.

On this page

Key takeaways

  • HTML (HyperText Markup Language) describes the structure and meaning of a web page; CSS handles looks and JavaScript handles behaviour.
  • Every page is a tree of elements written as tags, like <h1>, <p> and <a>.
  • Clean, semantic HTML is the foundation of fast, accessible and SEO-friendly websites — even if you use WordPress or a page builder.

Every website you’ve ever visited — from Google to a local bakery’s WordPress site — is delivered to your browser as HTML. You don’t need to become a developer to run a website, but understanding the basics of HTML makes you far better at SEO, at briefing developers, and at fixing the small problems that page builders create. This guide explains how web pages work, in plain English, with examples you can try.

What happens when you open a web page?#

  1. You request a URL. Your browser asks DNS which server hosts the domain, then sends an HTTP request to that server.
  2. The server responds with HTML. For WordPress, PHP builds the HTML on the fly from your theme and database (or serves a cached copy).
  3. The browser parses the HTML into a tree called the DOM, discovering links to CSS, JavaScript, images and fonts along the way.
  4. CSS is applied to decide colours, sizes and layout.
  5. JavaScript runs to add interactivity — menus, sliders, forms, chat widgets.
  6. The page is painted on screen, and updated as more resources arrive.

Search engines follow a very similar process. Googlebot fetches the HTML, renders it with a Chromium-based browser and reads the result. That’s why HTML quality directly affects SEO.

The anatomy of an HTML element#

<a href="https://iftikhar.in/seo-library/" title="Browse SEO terms">SEO Library</a>
  • <a> is the opening tag — this one creates a link.
  • href and title are attributes that add information.
  • SEO Library is the content (here, the anchor text).
  • </a> is the closing tag.

Some elements, like <img>, <br> and <meta>, are void elements with no closing tag.

A minimal, correct HTML page#

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Fresh Bakes | Bandra Bakery</title>
  <meta name="description" content="Handmade breads and cakes baked daily in Bandra, Mumbai.">
  <link rel="stylesheet" href="/style.css">
</head>
<body>
  <header><a href="/">Bandra Bakery</a></header>
  <main>
    <h1>Fresh bread, baked every morning</h1>
    <p>We open at 7am. <a href="/menu/">See today’s menu</a>.</p>
    <img src="/sourdough.webp" alt="Sourdough loaf on a wooden board" width="800" height="533">
  </main>
  <footer>© 2026 Bandra Bakery</footer>
</body>
</html>

Notice the two halves. The <head> contains information about the page — character set, title, description, stylesheets. The <body> contains what visitors actually see.

The elements you’ll use most#

Element Purpose SEO / accessibility note
<h1>–<h6> Headings One clear H1; logical H2/H3 structure — see header tags
<p> Paragraph Keep paragraphs short for readability
<a> Link Descriptive anchor text; real href values
<img> Image Always add alt, width and height
<ul>, <ol>, <li> Lists Great for steps and features; often used in snippets
<table> Tabular data Use for data, never for layout
<header>, <nav>, <main>, <footer> Page regions Help screen readers and crawlers understand layout
<button> Action on the page Use for actions; use <a> for navigation
<form>, <input>, <label> Forms Every input needs a label

Using elements for their real meaning is called semantic HTML. Read more in Semantic HTML: why the right tags matter.

Need a hand with this?

Get a quick, honest review of your website’s SEO.

Chat on WhatsApp

HTML, CSS and JavaScript: who does what?#

HTMLStructure and meaning: “this is a heading, this is a list, this is a link”.
CSSPresentation: colours, fonts, spacing, layout, dark mode. See CSS basics.
JavaScriptBehaviour: menus, forms, live search, chat. See JavaScript basics.

A good rule: content that matters for SEO should be in the HTML, not added later by JavaScript.

How to see the HTML of any page#

  • View source (Ctrl+U / Cmd+Option+U) shows the raw HTML the server sent — what crawlers see first.
  • Inspect element (right-click → Inspect) shows the live DOM after JavaScript ran, and lets you experiment with CSS.
  • In WordPress, switch a block to “Edit as HTML” or use a Custom HTML block to see and edit the markup of a section.

Common HTML mistakes on business websites#

  • Several <h1> tags used for styling, or headings skipped for font size.
  • Images without alt text or dimensions, causing accessibility issues and layout shift.
  • Links built with <div onclick> that crawlers and keyboards can’t follow.
  • Text placed inside images, so it can’t be read by search engines or translated.
  • Missing lang attribute and viewport meta tag.

Most of these are easy to catch with an HTML validator — see how to validate HTML — and a quick accessibility check.

Where to go next#

Once you’re comfortable reading HTML, learn what belongs in the page head (HTML head tags guide), how to make images responsive (responsive images) and how links work in depth (HTML links guide). These three topics alone fix most on-page technical SEO issues I see in audits.

HTML basics FAQ#

Is HTML a programming language?#

No. HTML is a markup language — it describes structure and meaning but has no logic like loops or conditions. JavaScript is the programming language of the browser.

Do I need to learn HTML if I use WordPress?#

You don’t need to write pages by hand, but basic HTML knowledge helps you fix formatting, understand SEO plugin output, add embeds safely and brief developers clearly.

What version of HTML should I use?#

Just use the modern standard (the “HTML Living Standard”, often called HTML5) by starting your page with <!doctype html>.

Found this useful? Share it

Join the discussion

Your email address will not be published. Required fields are marked *

Security code image. If you cannot read it, press refresh or contact me on WhatsApp.