HTML Tutorial for Beginners: A Complete Guide from First Page to Full Website

Web Development 30 min readUpdated Oct 30, 2026
3 views0 comments

HTML (HyperText Markup Language) is the language every web page is made of. When you open any website, your browser downloads an HTML file and turns it into the page you see. HTML does not “calculate” anything: it describes the structure and meaning of content: this is a heading, this is a paragraph, this is a list, this is a picture, this is a form. Two companions then take over: CSS controls how it looks, and JavaScript controls how it behaves. Learning HTML properly is the first step of web development, and it also pays off in SEO, accessibility and speed, because good HTML is what search engines and screen readers rely on.

This tutorial assumes nothing. By the end you will write complete, valid, accessible pages with text, links, images, tables, forms and semantic layout, and you will have built a full landing page. It is the first of three connected tutorials: continue with the CSS tutorial and the JavaScript tutorial. Every example here was checked for correct tag structure before publishing.

Contents

1. Your first web page

You need only two things: a text editor (Visual Studio Code is free and excellent; Notepad works too) and a web browser. Create a folder called mysite, create a file named index.html inside it, paste this, save, and double-click the file to open it in your browser:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My first page</title>
</head>
<body>
  <h1>Hello, web!</h1>
  <p>This is my <strong>first</strong> web page.</p>
</body>
</html>

That is a complete, valid page. Change the text, save, and press F5 in the browser to see the change. For a real server (needed later for forms and some features), run python -m http.server 8000 inside the folder and open http://localhost:8000, or use the Live Server extension of VS Code, which also reloads the page automatically.

Your most important tool is the browser’s Developer Tools: press F12 (or right-click and choose Inspect). The Elements panel shows the page’s HTML as the browser understood it, and lets you edit it live; Console shows errors; Network shows what was downloaded. Use it constantly.

2. The anatomy of an HTML document

HTML is written with elements. Most elements have an opening tag, content and a closing tag. Tags can carry attributes, which are name="value" pairs placed in the opening tag.

<a href="https://example.com" target="_blank" rel="noopener">Visit Example</a>
<!--  ^ tag  ^ attribute        ^ attribute    ^ attribute      ^ content     ^ closing tag -->

<img src="logo.png" alt="Company logo">     <!-- a "void" element: no content and no closing tag -->
<br>                                        <!-- also void: a line break -->

<p>A paragraph with <em>nested <strong>elements</strong></em>. They must close in the reverse order they opened.</p>

Rules to remember: elements nest inside each other and must close in reverse order (<em><strong>...</strong></em>, never crossed); attribute values go in quotes; tag names are not case-sensitive, but lower case is the standard; and browsers are forgiving, so a mistake will not stop the page, it will quietly produce a strange result. That is why you should validate your pages (section 14). White space collapses: any number of spaces and line breaks in the source show as a single space on screen, so use elements, not extra spaces, to create layout. Comments are written <!-- like this --> and are not displayed.

The skeleton, line by line

Part Purpose
<!DOCTYPE html> Tells the browser to use modern standards mode. Always the first line
<html lang="en"> The root element. lang is important for screen readers, translation and search engines (fr, ar, es…). For right-to-left languages also add dir="rtl"
<head> Information about the page: not displayed (except the title in the tab)
<meta charset="utf-8"> Character encoding. Without it, accents and symbols can turn into nonsense. Must be within the first 1024 bytes
<meta name="viewport" ...> Makes the page fit phone screens. Without it, mobile browsers show a tiny zoomed-out desktop page
<title> The text on the browser tab, in bookmarks and as the headline in Google results
<body> Everything the visitor sees

The <head> is also where you connect other files:

<link rel="stylesheet" href="style.css">          <!-- the CSS file -->
<link rel="icon" href="favicon.svg" type="image/svg+xml">   <!-- the little icon in the browser tab -->
<script src="app.js" defer></script>            <!-- JavaScript; defer waits until the HTML has been read -->
<style> body { margin: 0; } </style>             <!-- or put CSS directly in the page (fine for small tests) -->

3. Text

Choose the element that matches the meaning of the text, not the way it looks. Looks are CSS’s job.

<h1>Main title of the page</h1>         <!-- one h1 per page: what the page is about -->
<h2>A section</h2>
<h3>A subsection of that section</h3>  <!-- go down one level at a time: h1, h2, h3... never skip for style -->

<p>A paragraph is a block of text. <strong>Strong</strong> means important, <em>em</em> means stressed.</p>
<p>Use <b>b</b> and <i>i</i> only for style without extra meaning, such as a product name or a foreign word.</p>
<p>Line one<br>line two (a line break inside one paragraph, like an address or a poem).</p>
<hr>                                   <!-- a thematic break between topics -->

<blockquote cite="https://example.com/source">
  <p>A long quotation from another source.</p>
</blockquote>
<p>He said <q>short quotes go inline</q>. See <cite>The Pragmatic Programmer</cite>.</p>

<p>Run <code>npm install</code> to start. Press <kbd>Ctrl</kbd> + <kbd>S</kbd> to save.</p>
<pre>
function add(a, b) {
  return a + b;     /* pre keeps the spaces and line breaks exactly */
}
</pre>

<p>H<sub>2</sub>O and E = mc<sup>2</sup>. <mark>Highlighted</mark>. <del>old price</del> <ins>new price</ins>.</p>
<p><abbr title="HyperText Markup Language">HTML</abbr> was published on <time datetime="2026-10-30">30 October 2026</time>.</p>

Special characters. Some characters have meaning in HTML itself, so you write them as entities: &lt; for <, &gt; for >, &amp; for &, &quot; for a quote, &copy; for © and &nbsp; for a non-breaking space. If your file is saved as UTF-8 (the default in modern editors), you can type accents, Arabic, emoji and symbols directly.

Which element is a heading? The one that introduces a section. Headings give the page an outline that screen-reader users navigate by, and search engines use to understand it. Never choose a heading level because of its size, and never use bold text or a <p> where a heading belongs.

The anchor element <a> is what makes the web a web.

<a href="https://www.example.com/">An absolute URL: another website</a>
<a href="about.html">A relative URL: a file in the same folder</a>
<a href="/contact/">A root-relative URL: from the top of this website</a>
<a href="../index.html">One folder up, then index.html</a>
<a href="docs/guide.html#install">A section of another page</a>
<a href="#top">A link to an id on this page</a>
<a href="mailto:hello@example.com?subject=Hello">Send an email</a>
<a href="tel:+212600000000">Call us</a>
<a href="report.pdf" download>Download the report</a>
<a href="https://example.com" target="_blank" rel="noopener noreferrer">Opens in a new tab</a>

Write link text that makes sense on its own: “Read the pricing guide”, never “click here”, because screen readers can list all links on a page, and search engines read link text too. Use target="_blank" sparingly (with rel="noopener" for safety), as it takes control away from the visitor. Use https:// links wherever the site supports it.

Paths are the stumbling block for beginners. In src="images/logo.png" the browser looks for a folder images next to the current page. ../ means “go up one folder”. A path that starts with / starts at the root of the website. File names are case-sensitive on most servers (Logo.png and logo.png differ), so keep everything in lower case, without spaces: my-photo.jpg.

An id attribute makes an element a link target: <h2 id="install"> lets #install jump straight to it. Ids must be unique in a page.

5. Images, audio, video and iframes

Images

<img src="images/tangier.jpg" alt="Boats in the harbour of Tangier at sunset" width="800" height="533" loading="lazy">

<figure>
  <img src="images/chart.png" alt="Bar chart: sales doubled between 2024 and 2026" width="600" height="400">
  <figcaption>Figure 1: Sales by year</figcaption>
</figure>

<img src="images/divider.png" alt="" width="600" height="20">    <!-- purely decorative image: EMPTY alt, so screen readers skip it -->

Three attributes matter more than any others. alt is the text replacement for people who cannot see the image (and for search engines, and when the image fails to load): describe what the image means in the page. width and height give the real pixel size so that the browser reserves the space and the page does not jump while loading. loading="lazy" postpones images that are below the screen until the visitor scrolls near them (do not lazy-load the main image at the top).

Responsive images let the browser choose the right file for the screen, so phones do not download huge pictures:

<img src="images/hero-800.jpg"
     srcset="images/hero-400.jpg 400w, images/hero-800.jpg 800w, images/hero-1600.jpg 1600w"
     sizes="(max-width: 600px) 100vw, 800px"
     alt="Team working in the office" width="800" height="450">

<picture>                                   <!-- different formats: the browser takes the first one it supports -->
  <source type="image/avif" srcset="images/hero.avif">
  <source type="image/webp" srcset="images/hero.webp">
  <img src="images/hero.jpg" alt="Team working in the office" width="800" height="450">
</picture>

Use JPEG for photos, PNG for graphics that need transparency, WebP or AVIF for smaller files of either, and SVG for logos and icons (sharp at any size, tiny file). Prepare images before you upload them: resize them to the size you need and compress them with our free browser tools, the image resizer, image compressor and image converter. Nothing is uploaded: they run in your browser.

Audio, video and embeds

<video controls width="640" height="360" poster="images/poster.jpg" preload="metadata">
  <source src="media/intro.mp4" type="video/mp4">
  <source src="media/intro.webm" type="video/webm">
  <track kind="captions" src="media/intro.en.vtt" srclang="en" label="English">
  Your browser does not support video. <a href="media/intro.mp4">Download it</a>.
</video>

<audio controls src="media/podcast.mp3">Your browser does not support audio.</audio>

<iframe src="https://www.openstreetmap.org/export/embed.html?bbox=-5.9,35.7,-5.7,35.8"
        title="Map of Tangier" width="600" height="350" loading="lazy"></iframe>

Videos should not start by themselves with sound. Provide captions (<track>) for accessibility. An <iframe> embeds another page (a map, a YouTube video); always give it a title, and only embed sites you trust.

6. Lists and tables

<ul>                                  <!-- unordered: bullets -->
  <li>Bread</li>
  <li>Olive oil
    <ul>                               <!-- a list can be nested INSIDE an li -->
      <li>Extra virgin</li>
      <li>Regular</li>
    </ul>
  </li>
</ul>

<ol start="3" reversed>                <!-- ordered: numbers; use for steps and rankings -->
  <li>Third</li>
  <li>Second</li>
</ol>

<dl>                                   <!-- description list: terms and definitions -->
  <dt>HTML</dt><dd>The structure of a page</dd>
  <dt>CSS</dt><dd>The style of a page</dd>
</dl>

A navigation menu is just a list of links; use <ul> inside a <nav>, then style it with CSS. Tables are for data in rows and columns, never for page layout:

<table>
  <caption>Monthly sales (thousands of dollars)</caption>
  <thead>
    <tr><th scope="col">Month</th><th scope="col">Online</th><th scope="col">Shop</th></tr>
  </thead>
  <tbody>
    <tr><th scope="row">January</th><td>12</td><td>8</td></tr>
    <tr><th scope="row">February</th><td>15</td><td>9</td></tr>
  </tbody>
  <tfoot>
    <tr><th scope="row">Total</th><td>27</td><td>17</td></tr>
  </tfoot>
</table>

<table>
  <tr><th colspan="2">A header spanning two columns</th></tr>
  <tr><td rowspan="2">Tall cell</td><td>One</td></tr>
  <tr><td>Two</td></tr>
</table>

<th> marks header cells and scope tells screen readers whether a header describes a column or a row. <caption> names the table. On narrow screens a wide table should scroll sideways inside a wrapper (CSS: overflow-x: auto) instead of breaking the page.

7. Forms

Forms let visitors send information: sign up, search, contact, pay. A form groups controls and sends their values to the address in action, using the method (get puts the values in the address, for searches; post sends them in the request body, for anything private or that changes data).

<form action="/subscribe" method="post">
  <fieldset>
    <legend>Create your account</legend>

    <p>
      <label for="name">Full name</label>
      <input type="text" id="name" name="name" required autocomplete="name">
    </p>
    <p>
      <label for="email">Email</label>
      <input type="email" id="email" name="email" required autocomplete="email" placeholder="you@example.com">
    </p>
    <p>
      <label for="password">Password (at least 10 characters)</label>
      <input type="password" id="password" name="password" required minlength="10" autocomplete="new-password">
    </p>
    <p>
      <label for="age">Age</label>
      <input type="number" id="age" name="age" min="18" max="120" step="1">
    </p>
    <p>
      <label for="country">Country</label>
      <select id="country" name="country">
        <option value="">Choose...</option>
        <optgroup label="Africa">
          <option value="ma" selected>Morocco</option>
          <option value="eg">Egypt</option>
        </optgroup>
        <optgroup label="Europe">
          <option value="fr">France</option>
        </optgroup>
      </select>
    </p>
  </fieldset>

  <fieldset>
    <legend>Plan</legend>
    <label><input type="radio" name="plan" value="free" checked> Free</label>
    <label><input type="radio" name="plan" value="pro"> Pro</label>
  </fieldset>

  <p>
    <label for="bio">About you</label><br>
    <textarea id="bio" name="bio" rows="4" cols="40" maxlength="500"></textarea>
  </p>
  <p><label><input type="checkbox" name="terms" value="yes" required> I accept the terms</label></p>

  <button type="submit">Create account</button>
  <button type="reset">Clear</button>
</form>

The things that make a form work

  • <label for="id"> matched to the control’s id: clicking the label focuses the field, and screen readers announce it. Never use placeholder text instead of a label: it vanishes when you type.
  • name attribute: the key under which the value is sent. A control without a name sends nothing.
  • The right type: email, tel, url, number, date, time, color, range, search, file, checkbox, radio and hidden. Phones show the matching keyboard, and browsers validate the format.
  • Built-in validation: required, minlength, maxlength, min, max, pattern="[A-Z]{3}[0-9]{4}" and the type itself. The browser blocks submission and shows a message.
  • autocomplete: lets browsers and password managers fill fields correctly (name, email, username, current-password, new-password, one-time-code…).
  • Radio buttons with the same name form one group where only one can be chosen. Group related controls in a <fieldset> with a <legend>.
  • Buttons: <button type="submit"> sends, type="button" does nothing by itself (for JavaScript). A button inside a form is a submit button unless you say otherwise.
<form action="/search" method="get">
  <label for="q">Search</label>
  <input type="search" id="q" name="q" list="suggestions">
  <datalist id="suggestions">            <!-- suggestions while typing, but any text is allowed -->
    <option value="HTML"></option>
    <option value="CSS"></option>
    <option value="JavaScript"></option>
  </datalist>
  <input type="file" name="photo" accept="image/*">
  <button>Go</button>
</form>

Security: browser validation is a convenience, not protection. Anyone can bypass it in a few seconds with the developer tools, so the server must check everything again. Send forms over HTTPS, protect against cross-site request forgery with tokens, and never put secrets in hidden fields. A form needs a server-side program to receive the data: that is where languages such as PHP, Python or C# come in (see our C# tutorial for a small web API, and the Python tutorial).

8. Semantic layout

For years, pages were built from anonymous <div> boxes. HTML5 added elements that say what a part of the page is. This is called semantic HTML, and it helps search engines, screen-reader users (who jump between these regions), browsers’ reader modes, and you.

<body>
  <a class="skip" href="#main">Skip to the content</a>

  <header>                               <!-- the top of the page or of a section: logo, title -->
    <a href="/">My Site</a>
    <nav aria-label="Main">              <!-- major navigation links -->
      <ul>
        <li><a href="/">Home</a></li>
        <li><a href="/articles/">Articles</a></li>
        <li><a href="/contact/">Contact</a></li>
      </ul>
    </nav>
  </header>

  <main id="main">                       <!-- the unique main content: ONE per page -->
    <article>                            <!-- a self-contained piece: blog post, news story, product -->
      <h1>How to learn HTML</h1>
      <p>Published <time datetime="2026-10-30">30 October 2026</time> by <a href="/about/">Sara</a></p>

      <section>                          <!-- a themed group of content, usually with a heading -->
        <h2>Start with the basics</h2>
        <p>...</p>
      </section>
      <section>
        <h2>Practise every day</h2>
        <p>...</p>
      </section>
    </article>

    <aside>                              <!-- related but secondary: sidebar, related links -->
      <h2>Related</h2>
      <ul><li><a href="/css/">Learn CSS</a></li></ul>
    </aside>
  </main>

  <footer>                               <!-- the bottom: copyright, links, contact -->
    <address>Contact: <a href="mailto:hello@example.com">hello@example.com</a></address>
    <p>&copy; 2026 My Site</p>
  </footer>
</body>

Use <div> (a generic block) and <span> (a generic inline piece) only when no semantic element fits, typically as hooks for CSS. A page made only of divs is called “div soup”: it works for eyes but means nothing to machines. Block elements (p, div, h1, ul, section) start on a new line and take the full width; inline elements (a, strong, span, img) flow inside a line of text. CSS can change this.

9. Interactive and modern elements

HTML can now do things that once needed JavaScript:

<details>                                          <!-- a built-in expand/collapse, keyboard accessible -->
  <summary>What is your refund policy?</summary>
  <p>You can return any item within 30 days.</p>
</details>

<dialog id="confirm">                                <!-- a modal window; open it with JavaScript: confirm.showModal() -->
  <form method="dialog">
    <p>Delete this item?</p>
    <button value="cancel">Cancel</button>
    <button value="ok">Delete</button>
  </form>
</dialog>

<label for="done">Upload progress</label>
<progress id="done" value="70" max="100">70%</progress>     <!-- a task's progress -->
<label for="disk">Disk used</label>
<meter id="disk" value="0.85" min="0" max="1" low="0.5" high="0.8">85%</meter>   <!-- a measurement on a scale -->

<p hidden>This paragraph is not shown (the hidden attribute).</p>
<button type="button" data-product-id="42" data-action="add">Add to cart</button>   <!-- data-* attributes carry your own data for JavaScript -->
<p contenteditable="true">The visitor can edit this text.</p>

Other useful ones: <template> holds HTML that is not shown until JavaScript uses it, <canvas> is a surface for drawing with JavaScript, <svg> embeds vector graphics directly, and <noscript> shows content to visitors who have JavaScript off. Native elements such as <details>, <dialog> and <button> come with keyboard and screen-reader support for free: prefer them to making your own from a div.

10. Accessibility

Around one in five people has a disability that affects how they use the web: blindness, low vision, colour blindness, deafness, motor difficulties, dyslexia. Many more use the web with a broken arm, in bright sunlight or on a slow phone. Accessible pages work for all of them, rank better and are legally required in many countries. Good news: most of accessibility is just correct HTML.

  1. Use semantic elements (section 8) and a logical heading order.
  2. Give every image a meaningful alt (or alt="" when decorative), and captions or transcripts for audio and video.
  3. Label every form control with a real <label>, and describe errors in text, not only with a red border.
  4. Make everything usable with the keyboard alone: try Tab, Shift+Tab, Enter and Space. The focus outline must stay visible. Use real <a> and <button> elements: they work with the keyboard automatically, a clickable <div> does not.
  5. Do not rely on colour alone, and keep enough contrast between text and background (at least 4.5:1). Test pairs with our contrast checker.
  6. Declare the language with <html lang>, and write link text that makes sense out of context.
  7. Add a “skip to content” link at the top so keyboard users can jump past the menu.

ARIA attributes can fill gaps when no native element exists, but the first rule of ARIA is: do not use it if a native HTML element does the job. A few that are commonly needed:

<button type="button" aria-expanded="false" aria-controls="menu">Menu</button>   <!-- tells assistive tech the state of a toggle -->
<ul id="menu" hidden>...</ul>

<button type="button" aria-label="Close dialog">&times;</button>    <!-- a name for a button that shows only an icon -->
<nav aria-label="Breadcrumb">...</nav>                              <!-- distinguishes several navigations on one page -->
<div role="alert">Your password is too short.</div>                 <!-- read out at once when it appears -->

Test by tabbing through the page, by zooming to 200 percent, by turning on a screen reader (NVDA on Windows, VoiceOver on Mac and iPhone, TalkBack on Android) for ten minutes, and with the Lighthouse accessibility audit in Chrome’s developer tools.

11. The head: SEO and social sharing

The <head> tells search engines and social networks what your page is about. Add these to every public page:

<title>Learn HTML: A Complete Beginner Tutorial | My Site</title>
<meta name="description" content="Learn HTML step by step: text, links, images, forms and a complete landing page. Free and beginner friendly.">
<link rel="canonical" href="https://www.example.com/learn-html/">
<meta name="robots" content="index, follow">          <!-- use "noindex" on pages that should stay out of Google -->

<!-- Open Graph and Twitter cards: how the link looks when shared -->
<meta property="og:type" content="article">
<meta property="og:title" content="Learn HTML: A Complete Beginner Tutorial">
<meta property="og:description" content="Step by step, with examples.">
<meta property="og:image" content="https://www.example.com/images/share.jpg">
<meta property="og:url" content="https://www.example.com/learn-html/">
<meta name="twitter:card" content="summary_large_image">

<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Article", "headline": "Learn HTML",
  "author": { "@type": "Person", "name": "Sara" }, "datePublished": "2026-10-30" }
</script>

The title (about 50 to 60 characters) and description (120 to 160) are what people read in search results, so they decide whether they click. Generate and check these tags with our free meta tag generator, which shows a live Google preview, and use the robots.txt generator and sitemap generator to help search engines crawl your site. Share images work best at 1200 by 630 pixels. The JSON-LD block is structured data: it tells search engines facts about the page in a machine-readable way and can earn rich results.

12. Performance and good practice

  • Images are usually the heaviest part. Resize and compress them, use modern formats, give them width and height, and add loading="lazy" below the fold.
  • Load scripts with defer (or at the end of the body) so they do not block the page from appearing.
  • Keep the HTML simple. Fewer nested wrappers mean a faster, easier page.
  • Keep CSS and JavaScript in separate files that the browser can cache, instead of repeating them in every page.
  • Serve the site over HTTPS, with compression and HTTP/2. You can measure your page, find out whether compression and caching are on, and see what to fix with our page speed checker.
  • Use lower-case file names without spaces, and a clear folder structure (css/, js/, images/).
  • Do not use inline styles and <br> for spacing: that belongs in CSS.
  • Test on a real phone and on a slow connection.

13. Project: a complete landing page

Let us combine everything into one page: a landing page for a fictional online course. It uses the semantic layout, a navigation list, an image, a features list, a pricing table, an FAQ with <details> and an accessible sign-up form. Save it as index.html. (We keep a tiny stylesheet inside the page so it already looks decent; the CSS tutorial shows how to style it properly.)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>CodeStart: Learn Web Development in 8 Weeks</title>
  <meta name="description" content="A friendly 8-week online course that teaches HTML, CSS and JavaScript from zero. Start free.">
  <link rel="canonical" href="https://www.example.com/">
  <meta property="og:title" content="CodeStart: Learn Web Development in 8 Weeks">
  <meta property="og:type" content="website">
  <style>
    body { font-family: system-ui, sans-serif; line-height: 1.6; max-width: 56rem; margin: 0 auto; padding: 0 1rem; color: #1e293b; }
    header, footer { padding: 1rem 0; }
    nav ul { display: flex; gap: 1rem; list-style: none; padding: 0; }
    table { border-collapse: collapse; width: 100%; }
    th, td { border: 1px solid #cbd5e1; padding: .5rem; text-align: left; }
    label { display: block; margin-top: .75rem; font-weight: 600; }
    .skip { position: absolute; left: -999px; }
    .skip:focus { left: 0; background: #fff; padding: .5rem; }
  </style>
</head>
<body>
  <a class="skip" href="#main">Skip to the content</a>

  <header>
    <strong>CodeStart</strong>
    <nav aria-label="Main">
      <ul>
        <li><a href="#features">Features</a></li>
        <li><a href="#pricing">Pricing</a></li>
        <li><a href="#faq">FAQ</a></li>
        <li><a href="#signup">Sign up</a></li>
      </ul>
    </nav>
  </header>

  <main id="main">
    <section>
      <h1>Learn web development in 8 weeks</h1>
      <p>HTML, CSS and JavaScript from zero, with a real project every week.</p>
      <p><a href="#signup">Start free</a></p>
      <img src="images/course.jpg" alt="Students building a website together at a laptop" width="800" height="450" loading="lazy">
    </section>

    <section id="features">
      <h2>What you get</h2>
      <ul>
        <li><strong>Weekly projects:</strong> build a portfolio you can show to employers.</li>
        <li><strong>Friendly mentors:</strong> answers within one working day.</li>
        <li><strong>Lifetime access:</strong> learn at your own speed.</li>
      </ul>
    </section>

    <section id="pricing">
      <h2>Pricing</h2>
      <table>
        <caption>Choose your plan</caption>
        <thead>
          <tr><th scope="col">Plan</th><th scope="col">Price per month</th><th scope="col">Includes</th></tr>
        </thead>
        <tbody>
          <tr><th scope="row">Free</th><td>$0</td><td>Weeks 1 to 2</td></tr>
          <tr><th scope="row">Full</th><td>$19</td><td>All 8 weeks and mentoring</td></tr>
        </tbody>
      </table>
    </section>

    <section id="faq">
      <h2>Questions</h2>
      <details>
        <summary>Do I need experience?</summary>
        <p>No. The course starts with the very first line of HTML.</p>
      </details>
      <details>
        <summary>Can I cancel at any time?</summary>
        <p>Yes, with one click, and you keep access until the end of the month.</p>
      </details>
    </section>

    <section id="signup">
      <h2>Sign up</h2>
      <form action="/signup" method="post">
        <label for="s-name">Your name</label>
        <input type="text" id="s-name" name="name" required autocomplete="name">

        <label for="s-email">Email address</label>
        <input type="email" id="s-email" name="email" required autocomplete="email">

        <label for="s-plan">Plan</label>
        <select id="s-plan" name="plan">
          <option value="free">Free</option>
          <option value="full" selected>Full ($19 per month)</option>
        </select>

        <label><input type="checkbox" name="news" value="yes"> Send me learning tips by email</label>
        <p><button type="submit">Create my account</button></p>
      </form>
    </section>
  </main>

  <footer>
    <p>&copy; 2026 CodeStart. <a href="mailto:hello@example.com">hello@example.com</a></p>
  </footer>
</body>
</html>

Open it and check it: tab through it with the keyboard, shrink the window, view it with the developer tools. Then make it yours: replace the course with your own business, a CV or a portfolio, add your photo with proper alt text, and continue with CSS to give it a real design.

14. Common mistakes, cheat sheet and FAQ

Mistakes everybody makes once

  • Missing alt, missing label, skipped heading levels: the three most common accessibility failures.
  • Unclosed or crossed tags (<b><i>...</b></i>). The browser guesses what you meant, and guesses differently from you.
  • Using <br> and &nbsp; for spacing. Use paragraphs and CSS margins.
  • Using a table for page layout. Tables are for data; use CSS (flexbox, grid).
  • Putting a block element inside a paragraph (<p><div>...</div></p>), or an <a> inside an <a>, or a <button> inside a link. These are invalid and behave unpredictably.
  • Duplicate ids: they must be unique.
  • Forgetting the viewport meta tag, so phones show the desktop layout shrunk.
  • Wrong file paths and capital letters: works on your Windows PC, breaks on the Linux server.
  • Relying on browser validation alone for forms.

To find mistakes, paste your page into the free W3C Markup Validator (validator.w3.org) and read the error list from the top, because one early mistake often causes many later ones.

Quick reference

You want Use
A heading <h1> to <h6>
A paragraph, emphasis, importance <p>, <em>, <strong>
A link <a href="...">
A picture <img src alt width height>, <picture>
A list <ul>, <ol>, <li>
Tabular data <table>, <tr>, <th>, <td>
A form <form>, <label>, <input>, <select>, <textarea>, <button>
Page regions <header>, <nav>, <main>, <article>, <section>, <aside>, <footer>
Expand and collapse <details> and <summary>
A generic wrapper <div> (block), <span> (inline)

Quick answers

Is HTML a programming language? No. It is a markup language: it describes content but has no logic, variables or loops. Programming begins with JavaScript.

Do I need to memorise all the elements? No. Learn about thirty common ones and look up the rest. MDN Web Docs (developer.mozilla.org) is the best free reference.

What is HTML5? The current generation of the standard (the semantic elements, forms, audio, video, canvas). Today it is simply “HTML”: a living standard that browsers keep updating.

What should I learn next? CSS, to style the page you just built: continue with our CSS tutorial, then make it interactive with the JavaScript tutorial. If you run your own server, our guides on free HTTPS with Let’s Encrypt and the Linux commands show how to publish it.

Did you find this helpful?Tap the heart to let us know. It takes one second and no account.

More tutorials like this

Leave a Comment

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

Bigland Network IT

Practical tutorials for people who run, build and fix things: operating systems, databases, development, networking and security.

Topics

More

Site

© 2026 Bigland Network. All rights reserved.Always test commands on a non-production system first.
Scroll to Top