Practice by topic / Python & code / HTML

HTML Exercises

HTML is the structure of every web page. These exercises have you write real tags, the quickest way to understand how pages are built. These 3 exercises build up step by step, starting with your first heading, link to another page, collect an email address.

3 of 3 free · no sign-up needed · instant feedback

1

Your First Heading

Free

Write the HTML tag that creates a top-level heading containing the text "Welcome".

Show the solution

Use the h1 tag, wrapping your text like this: <h1>Welcome</h1>

Right — <h1>Welcome</h1> is the correct way to mark up a top-level heading; there should only be one per page.

Try it in the live editor →
2

Link to Another Page

Free

Write an anchor tag that links to "https://example.com" with the visible text "Visit Example".

Show the solution

Use an anchor tag: <a href="https://example.com">Visit Example</a>

Nice — <a href="https://example.com">Visit Example</a> is exactly how you create a clickable link with custom text.

Try it in the live editor →
3

Collect an Email Address

Free

Write the input element you'd put inside a form to collect a user's email address.

Show the solution

Use <input type="email" name="email"> — the type="email" attribute gives you free format validation.

Good — <input type="email"> gives you built-in format validation for free, which a plain text input doesn't.

Try it in the live editor →