HTML Tutorial

Beginner
12 min read
Updated: Nov 2026
HTML for beginners

Every website you open starts as HTML. This tutorial shows how that plain text becomes headings, links, forms, and pictures a browser can display.

What is HTML?

HTML stands for HyperText Markup Language. It is the language that describes the structure of a web page. You label each piece of content, and the browser uses those labels to build what people see.

  • HyperText Links that jump from one page to another.
  • Markup Labels that say what each part of the content is.
  • Language A shared set of rules every browser understands.

HTML is a markup language. It describes content. A programming language such as JavaScript runs instructions and makes decisions. HTML tells the browser, “this is a heading,” “this is a paragraph,” and “this is a link.”

The foundation under every site. News, shops, docs, and web apps all send HTML to the browser. CSS paints that structure. JavaScript makes it react. The page still starts with HTML elements.

Why Learn HTML?

HTML for beginners is a short climb with a wide view. A few tags are enough to publish a real page, and every later web skill attaches to those tags.

It holds the page up

Search tools, screen readers, and browsers all read the structure you write. Clear HTML elements make the rest of the page easier to style and easier to find.

You see results immediately

Save a file that ends in .html and open it in a browser. There is no compile step and no account required for local practice.

CSS and JavaScript need it

Styles select HTML elements. Scripts update them. If the structure is solid, presentation and behavior have something reliable to attach to.

It shows up everywhere

Websites, email layouts, in-app help, and documentation all use HTML tags. Learning it once pays off across the work.

How HTML Works

You write text. The browser turns HTML tags into a tree of elements called the DOM, the Document Object Model, then paints that tree on screen.

  1. 1

    Write

    Create a text file and save it with an .html extension.

  2. 2

    Parse

    The browser reads the tags and builds a tree of HTML elements.

  3. 3

    Fetch

    It loads the CSS, images, and scripts your HTML points to.

  4. 4

    Show

    The page appears. JavaScript can change the tree later.

Browsers are forgiving. A missing end tag may still display. Write the tags anyway. Predictable HTML elements are easier to style, test, and share.

Basic Structure of an HTML Document

A modern page has a doctype, a root <html> element, a <head> for metadata, and a <body> for everything people see. Choose a part of the diagram to see its job.

Choose any box. The panel explains that part of the document.

skeleton.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Page title</title>
</head>
<body>
  <header>...</header>
  <nav aria-label="Primary">...</nav>
  <main>...</main>
  <footer>...</footer>
</body>
</html>
  • charsetUTF-8 lets the page show languages and symbols correctly. See charset.
  • viewportAsks phones to size the page to the screen. It belongs in the head.
  • langNames the page language for browsers and assistive tech. See language codes.
  • titleThe text on the browser tab. It also helps people scanning search results.

A heading is a rank, and a font size is a style. Use one <h1> for the page title, then <h2> and <h3> in order. Change the size later with CSS.

HTML Tags vs HTML Elements

People often say “p tag” for the whole paragraph. The precise split still helps when a page misbehaves: HTML tags are the markers, and the HTML element is the whole piece the browser builds.

One element, pulled apart
CompareHTML tagHTML element
What it isThe marker you typeThe full piece in the page
How it looks<p> and </p><p>Hello</p>
ContentA tag holds no sentence by itselfThe element includes the words between the tags
Empty elementsA start tag is enough<img>, <br>, <meta>, <input>, and <link> have no end tag

Write the end tag for every element that contains content. Lowercase tag names are the modern habit, even though HTML treats <P> and <p> as the same tag. The full list lives in the HTML tags reference.

HTML Attributes

An HTML attribute adds a fact to the start tag. It does not replace the element. The name and the value usually look like name="value".

attributes.html
<a href="/html/basic">Continue the HTML tutorial</a>

<img
  src="bike.jpg"
  alt="Red bicycle beside a cafe window"
  width="640"
  height="480">

<label for="email">Email</label>
<input id="email" name="email" type="email" autocomplete="email" required>
AttributeWhat it tells the browser
hrefWhere a link goes
srcWhich image, audio, or video file to load
altThe text alternative when an image cannot be seen
langThe language of the page or a phrase
class and idNames that CSS and JavaScript can find later
for and idWhich label belongs to which form control

required is a boolean attribute. Its presence turns the check on, so you can write required on its own. Attributes such as class, id, lang, and hidden are global: they fit almost any element. Others, such as href, belong to specific elements. The attributes reference sorts them out.

Write the text alternative on purpose. A useful alt describes the picture. A decorative picture gets an empty alt="". Leaving alt off can make assistive technology read the file name instead.

Key Features of HTML

Modern HTML, the feature set people still call HTML5, gives you meaningful regions, links, forms, and media without a plugin.

Semantic elements

<header>, <nav>, <main>, <article>, <section>, <aside>, and <footer> describe regions. Meaning travels with the content.

Hyperlinks

The <a> element is the “hyper” in HyperText. One attribute, href, connects this page to the next.

Forms that check themselves

Labels, inputs, and buttons collect information. Types such as email, and attributes such as required, give you browser checks before any script runs.

Native media

<img>, <picture>, <audio>, and <video> embed pictures and recordings. <canvas> is there when you need to draw.

Accessibility in the elements

The right element carries keyboard behavior and a role. A <button> is a button. A <a href> is a link. Extra attributes fill the gaps, such as alt and label.

One file, every browser

The same HTML tags work in Chrome, Firefox, Safari, and Edge. You practice locally, then publish the file when you are ready.

HTML Versions and the HTML Living Standard

HTML used to ship as frozen, numbered documents. The language you are learning now is a living standard: browsers follow the current specification, and new features arrive there.

  1. 1991

    The first HTML

    Tim Berners-Lee introduced HTML so documents could link to each other.

  2. 1999

    HTML 4.01

    A finished specification. Pages from this era often mixed structure with presentation.

  3. 2014

    HTML5

    The feature generation behind today’s habits: semantic elements, audio, video, canvas, and richer forms. The name stuck.

  4. Today

    HTML Living Standard

    The specification browsers implement. The WHATWG updates it as the web gains features. There is no HTML6 you need to wait for.

When a tutorial says HTML5, it usually means this modern style: <!DOCTYPE html>, semantic elements, and native media. Write that way and you are writing the living standard. Leave obsolete tags such as font and center in the deprecated list.

What Can You Build with HTML?

HTML structures the pieces people use: navigation, forms, pictures, and video. Switch the examples, then open the matching lesson when you want the full tour.

These links are real. A <nav> groups them so the region has a name.

<nav aria-label="Primary">
  <a href="/html">Home</a>
  <a href="/html/basic">Guides</a>
  <a href="/html/editors">About</a>
</nav>

HTML vs CSS vs JavaScript

Each language has one job. Pages feel polished when you let each one do that job.

HTML

Structure

Names the content: headings, links, forms, and images.

<h1>Hello</h1>

CSS

Presentation

Sets color, type, spacing, and layout.

h1 { color: navy; }

JavaScript

Behavior

Reacts to people, updates the page, and loads data.

button.addEventListener(...)
QuestionHTMLCSSJavaScript
JobStructure and meaningLook and layoutBehavior
You writeHTML elements and textRules that select those elementsScripts that respond to events
Usual file.html.css.js
Reach for it whenYou add or organize contentYou change how something looksThe page should react or fetch data

This HTML tutorial stays on structure. When you are ready, connect a stylesheet in Add CSS to HTML and a script in JavaScript in HTML.

What You Will Learn in This HTML Tutorial

This page is the map. Each card opens a part of the HTML tutorial, from the first skeleton to forms, media, CSS, and JavaScript.

HTML Learning Roadmap

Follow the steps in order. Each one assumes the step before it, and you can pause to practice a single page.

  1. 1

    Introduction

    You are here: what HTML is, and how a document fits together.

  2. 2

    HTML Basic

    Write a complete starter page and open it in a browser.

  3. 3

    Editors and comments

    Choose a tool, then leave notes with HTML comments.

  4. 4

    Tags and attributes

    Study elements and the attributes that configure them.

  5. 5

    Structure the page

    Head metadata, text, lists, and tables. Special characters are covered in entities.

  6. 6

    Forms and media

    Collect input, then add images, audio, and video.

  7. 7

    Style and behavior

    Attach CSS, then add JavaScript when the page should react.

  8. 8

    CSS, then JavaScript

    Move on to the CSS tutorial and the JavaScript tutorial with HTML already in place.

Prerequisites

You can start this HTML tutorial today. Nothing else has to be installed first.

Enough to begin

  • A current web browser
  • Any text editor, from Notepad to a code editor
  • A folder where you can save a file

Helpful later

  • An editor with highlighting, covered in HTML Editors
  • CSS, once you want color and layout
  • JavaScript, once you want the page to react

Your First HTML Program

Save this as index.html and open it in a browser. It uses the document shape from this page: a doctype, metadata, and semantic regions.

index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My First HTML Page</title>
</head>
<body>
  <header>
    <h1>Hello, HTML</h1>
    <p>This page is built with HTML elements.</p>
  </header>

  <nav aria-label="On this page">
    <a href="#about">About</a>
  </nav>

  <main id="about">
    <h2>Why this works</h2>
    <ul>
      <li>The doctype selects modern HTML.</li>
      <li>The heading and list describe the content.</li>
      <li>The link is real hypertext.</li>
    </ul>
  </main>

  <footer>
    <p>Save this file as index.html and open it in a browser.</p>
  </footer>
</body>
</html>
Try It Yourself
  • DoctypeSelects the modern HTML parsing rules.
  • HeadStores the charset, the viewport, and the tab title.
  • Body regionsheader, nav, main, and footer describe the page.
  • ContentThe heading, list, and link are ready for CSS later.

Habits and beginner mistakes

Habits worth keeping

  • Put <!DOCTYPE html> on the first line.
  • Close every element that contains content.
  • Use heading ranks in order, starting at h1.
  • Give every image an alt and every control a <label>.
  • Use lowercase tags and quote attribute values.

Common beginner mistakes

  • Picking h1 only because the text looks bigger.
  • Wrapping the whole page in div when a semantic element fits.
  • Skipping alt, or using the file name as the description.
  • Using obsolete tags such as font and center for layout.
  • Placing visible content in the head.

Frequently Asked Questions

HTML (HyperText Markup Language) is the standard markup language for web pages. HTML elements label headings, paragraphs, links, images, and forms so a browser can show them as a page.
HTML stands for HyperText Markup Language. HyperText means links between pages. Markup means labels that describe content. Browsers share these rules, so the same file opens everywhere.
HTML is a markup language. It describes the content of a page. Programming languages such as JavaScript run instructions, make decisions, and update the page after it loads.
An HTML tag is a marker, such as a start tag and an end tag. An HTML element is the whole unit: the tags plus the content. Void elements such as img and input have a start tag and no end tag.
An HTML attribute adds information to a start tag. href sets a link destination, src points to a file, and alt provides a text alternative for an image. Global attributes such as class, id, and lang can appear on almost any element.
HTML5 names the generation of features that added semantic elements, audio, video, canvas, and richer forms. The current specification is the HTML Living Standard. It is updated continuously, so there is no newer numbered edition to wait for.
A text editor and a web browser are enough. Save a file with a .html extension and open it in the browser. A code editor is helpful, and the Try It editor on this page runs the first example in the browser.
Continue with HTML Basic for the document skeleton and everyday elements. Then explore tags, attributes, forms, images, and multimedia. Add CSS for presentation and JavaScript for behavior when the structure feels comfortable.

Did you know?

An HTML document starts with <!DOCTYPE html>. Semantic elements such as <header>, <nav>, <main>, and <footer> name the regions of the page. Continue with HTML Basic.

Next: HTML Basic

Build the same skeleton with headings, lists, and links you can practice in the editor.

HTML Basic →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful