Skip to content
AI Exercises
–points–day streak

What is HTML?

HTML is the code that says what's on a web page: this is a heading, this is a paragraph, this is a button, this is a picture.

In real life

Like the frame and rooms of a house: it decides what's there and where, before any paint or furniture.

Try it yourself

Screen size

Switches

This lesson
rosas-bakery.example
Rosa's Bakery
Basket (0)

Fresh bread, baked at 6am

Order by 10am, collect after lunch.

  • Sourdough loaf

    £4.00

  • Cinnamon bun

    £2.50

  • Lemon cake

    £3.00

The code behind it (simplified)

HTML: what's on the page

<h1>Fresh bread, baked at 6am</h1>
<p>Order by 10am, collect after lunch.</p>
<li class="card">
  <img src="sourdough.svg" alt="Sourdough loaf">
  <h2>Sourdough loaf</h2>
  <p>£4.00</p>
  <button>Add to basket</button>
</li>

CSS: how it looks

.card {
  border: 2px solid navy;
  border-radius: 20px;
}
button {
  background: yellow;
  font-weight: bold;
}

JavaScript: how it reacts

button.onclick = () => {
  basket = basket + 1;
  showBasketCount(basket);
};

The HTML says what's on the page. Switch CSS off to see the HTML on its own.

Where you will use this

  • Module 4: Code without fearComing soon
  • Module 6: Getting found (titles and headings)Coming soon

Quick check: HTML

Question 1 of 3

What does HTML do?

What does HTML do?