Skip to main content

HTML Exercises: Write your first heading and paragraph: practice exercise

HTML5andCSS3 logo

0 of 42 solved

Add an <h1> with the exact text "Hello, HTML" and one paragraph describing yourself in at least one sentence.

Acceptance criteria

  1. 1.Add an <h1> heading.
  2. 2.The heading should say "Hello, HTML".
  3. 3.Add a paragraph describing yourself.

1
0 × 0

Your page appears here. Press Run to see it, or Submit to check your answer.

HTML exercises with solutions

Pick a result and write the HTML that makes it. Every exercise here runs without an account.

Exercises
162
Topics
17
Solved by you
0

162 shown

HTML Basics

  1. 1. Write your first heading and paragraph

    Add an <h1> with the exact text "Hello, HTML" and one paragraph describing yourself in at least one sentence.

    More on Introduction to HTML
    Show solution
    <h1>Hello, HTML</h1>
    <p>I am learning how to build web pages from scratch.</p>
  2. Show solution
    <h1>My Page</h1>
    <p>Written in an editor.</p>
  3. 3. Describe the page for search engines

    Add a <meta name="description"> tag whose content starts with "Recipes for busy weeknights": this is the summary search engines show under your page title.

    More on HTML Structure
    Show solution
    <title>Weeknight Recipes</title>
    <meta name="description" content="Recipes for busy weeknights, ready in 30 minutes or less.">
    <h1>Weeknight Recipes</h1>
  4. 4. Open a new tab safely

    Add a link with the text "Open documentation" pointing to https://developer.mozilla.org that opens in a new tab. Because it opens a new tab, protect the original page with rel="noopener noreferrer".

    More on HTML Elements & Attributes
    Show solution
    <p><a href="https://developer.mozilla.org" target="_blank" rel="noopener noreferrer">Open documentation</a></p>
  5. 5. Add a page title heading

    Add an h1 containing "Frontend Handbook".

    More on HTML Headings
    Show solution
    <h1>Frontend Handbook</h1>
  6. 6. Write three separate paragraphs

    Write three separate <p> elements, one idea in each.

    More on HTML Paragraphs
    Show solution
    <p>Paragraphs are the basic unit of text on the web.</p>
    <p>Each one is its own block, with space before and after.</p>
    <p>Splitting ideas into paragraphs makes content easier to scan.</p>
  7. 7. Mark real importance with <strong>

    Write a warning paragraph where the phrase "This action cannot be undone" is wrapped in <strong>, not just bold styling, but real importance a screen reader will announce.

    More on HTML Formatting
    Show solution
    <p>Deleting this file is permanent. <strong>This action cannot be undone</strong>.</p>
  8. 8. Add a comment above a heading

    Add an HTML comment, then an h1 saying "Docs".

    More on HTML Comments
    Show solution
    <!-- Page title -->
    <h1>Docs</h1>
  9. 9. Add an inline style

    Give a paragraph a red colour using the style attribute.

    More on HTML Styles
    Show solution
    <p style="color: red">Alert</p>

HTML Lists and Tables

  1. Show solution
    <ul>
      <li>HTML</li>
      <li>CSS</li>
      <li>JavaScript</li>
    </ul>
  2. 15. Build a pricing table

    Build a table with a <thead> row of column headers (Plan, Price, Storage) and a <tbody> with at least two plan rows. Use <th> for the header cells.

    More on HTML Tables
    Show solution
    <table>
      <thead>
        <tr><th>Plan</th><th>Price</th><th>Storage</th></tr>
      </thead>
      <tbody>
        <tr><td>Starter</td><td>$9</td><td>10GB</td></tr>
        <tr><td>Pro</td><td>$19</td><td>100GB</td></tr>
      </tbody>
    </table>
  3. Show solution
    <table>
      <tr><th scope="col">Name</th></tr>
    </table>

HTML Images and Media

  1. 17. Create an accessible image figure

    Improve the image by adding the exact alternative text “HTML and CSS workspace”. Then place it inside a figure and add a figcaption.

    More on HTML Images
    Show solution
    <div class="gallery">
      <figure>
        <img src="https://ik.imagekit.io/html5andcss3/tools-icon/tryit-editor.png" alt="HTML and CSS workspace">
        <figcaption>Practice code and preview the result.</figcaption>
      </figure>
    </div>
  2. Show solution
    <picture>
      <img src="/photo.jpg" alt="Photo">
    </picture>
  3. 19. Add an audio player

    Add an audio element with controls.

    More on HTML Audio
    Show solution
    <audio src="/clip.mp3" controls></audio>
  4. 20. Add a video player

    Add a video element with controls.

    More on HTML Video
    Show solution
    <video src="/film.mp4" controls></video>
  5. Show solution
    <embed src="/guide.pdf" type="application/pdf">

HTML Forms

  1. 22. Add a form

    Add a form element containing a submit button.

    More on HTML Forms Overview
    Show solution
    <form>
      <button type="submit">Send</button>
    </form>
  2. 23. Add a dropdown

    Add a select with two options.

    More on HTML Form Elements
    Show solution
    <select name="plan">
      <option>Free</option>
      <option>Pro</option>
    </select>
  3. Show solution
    <input type="email" name="email">
  4. Show solution
    <input name="email" placeholder="you@example.com">
  5. 26. Target a new tab

    Make the form submit into a new tab.

    More on HTML Form Attributes
    Show solution
    <form action="/go" target="_blank"><button>Go</button></form>
  6. Show solution
    <input type="email" name="email" required>

HTML Layout

  1. Show solution
    <div>
      <p>Block content</p>
    </div>
  2. Show solution
    <div>
      <p>One</p>
      <p>Two</p>
    </div>
  3. 30. Add a page header

    Add a header containing a site name.

    More on HTML Semantic Layout Tags
    Show solution
    <header><h1>Site</h1></header>
  4. 31. Embed a page

    Add an iframe pointing at /widget.

    More on HTML Iframes
    Show solution
    <iframe src="/widget" title="Widget"></iframe>

Advanced HTML

  1. 32. Escape a less-than sign

    Show a literal < character using an entity.

    More on HTML Entities & Symbols
    Show solution
    <p>&lt;div&gt;</p>
  2. 33. Add an emoji

    Show a rocket emoji in a paragraph.

    More on HTML Emojis
    Show solution
    <p>🚀 Launch</p>
  3. 34. Set the page title

    Add a title element for the browser tab.

    More on HTML Head Element Tags
    Show solution
    <title>HTML Practice</title>
  4. 35. Add a description

    Add a meta description for search results.

    More on HTML Meta Tags for SEO
    Show solution
    <meta name="description" content="Learn HTML and CSS with hands-on practice.">
  5. 36. Let images scale down

    Add a class so the image can shrink with its container.

    More on HTML Responsive Design
    Show solution
    <img src="/a.jpg" alt="Scene" class="fluid">

HTML References

  1. 37. Use the new landmarks

    Add a header, a main and a footer.

    More on HTML5 New Tags
    Show solution
    <header><h1>Site</h1></header>
    <main><p>Body</p></main>
    <footer><p>© 2026</p></footer>
  2. 38. Replace center

    Centre content with a class instead of the center element.

    More on Deprecated Tags
    Show solution
    <div class="centered">
      <p>Centred</p>
    </div>
  3. Show solution
    <p id="intro">Welcome</p>
  4. 40. Give the button an id

    Add a button a script can find by id.

    More on Event Attributes
    Show solution
    <button type="button" id="save">Save</button>
  5. 41. A heading and text

    Add a heading followed by a paragraph.

    More on Complete HTML Tag List
    Show solution
    <h1>Title</h1>
    <p>Body</p>
  6. Show solution
    <header><h1>Site</h1></header>
    <nav><a href="/">Home</a></nav>
    <main><p>Body</p></main>
    <footer><p>© 2026</p></footer>

HTML exercises by tag

812 HTML exercises in all

The first in every lesson is free. The rest come with the practice plan, and your first month costs nothing.

See the practice plan

Stuck on a topic?

Read the lesson in the HTML tutorial, then come back and solve it.

HTML tutorial

Make it look good

Style your pages with the CSS exercises.

CSS exercises

Ready to build?

Put the tags together in ten small HTML and CSS projects.

See the projects