Your workshop / Today
RU 0 XP
LESSON 01 · HTML

Your first page in four small steps

One part at a time. You can pause and continue later.

~ 30 min
A word from your mentor

Adjust tone →

Part 1 of 4

Read six lines

~ 5 min

HTML marks the role of text. <p> and </p> are opening and closing tags. Together with the text between them, they form an element: a box with contents. Let’s read one line at a time.

h1 — heading · p — paragraph · ul — list · li — item

Choose a line to see its role. Pressing Enter alone does not add a list item.

How it looks in a browser

h1 is the main page heading. The / in </h1> closes it.

Why it works this way

h1 gives text a role, not a fixed font size. A heading can have small letters and remain a heading. The / before the same name, h1, marks its end.

Need the terms explained?
<p>My idea</p>

A tag is a marker; an element is the whole unit

Think of a box with something inside. <p> marks the start, </p> marks the end, and “My idea” sits between them. The two markers are tags. The whole unit, including the text, is a p element: a paragraph.

<h1>A heading</h1>

The slash marks the closing tag

The opening tag is <h1>. The closing tag adds / before the name: </h1>. The name stays the same. In this lesson, we explicitly close h1, p, ul and li so their boundaries are easy to see. Later you will meet elements that do not need a closing tag.

<h1>My workshop</h1> <p>I build shelves here.</p>

Meaning first, appearance second

h1 marks the main heading of our page; p marks an explanatory paragraph. Browsers usually display them differently, but styles can change their font size. Choose h1 because the text is a heading, not because you want large letters.

<ul> <li>Tape measure</li> <li>Pencil</li> </ul>

The list is the box; the items go inside

ul groups an unordered list. Each li inside it is a separate item. There are two li elements here, so there are two items. Use this kind of list when rearranging the items does not change the meaning. We will use ol for a meaningful order later.

<ul> <li>Measure the wall</li> </ul>

Nesting: close from the inside out

The li sits inside the ul, like a small box inside a larger one. In our examples, we close </li> before </ul>. Leading spaces help you see the nesting. The tags create the relationship; the spaces do not.

<li>A book about space and notes about stars</li>

Enter does not create another item

The text uses two lines in the editor, but both lines are inside one li. That means one item. Line breaks and indentation make source code easier to read; a separate list item needs a separate li element.

CHECK YOUR PREDICTION

Before running the code, predict how many items this list contains.

<ul>
  <li>A book about space
      and notes about stars</li>
  <li>A short story collection</li>
</ul>

Build. Check. Explain.Short parts · details on demand · v0.3.1