Comments and neat nesting
Эта страница требует современного браузера (с поддержкой SharedArrayBuffer). Пожалуйста, обновите Chrome, Edge, Firefox или Safari до последней версии.
English
Comments
- A comment is a note for you, not for the reader.
- The browser ignores it — it never shows on the page.
- Write it like this:
<!-- this is a comment -->.
English
<!-- The header goes here -->
<h1>Welcome</h1>
<!-- TODO: add a photo below -->
English
Tags go inside tags
- HTML tags nest: one pair can sit inside another.
- A
<div>is a plain box you can put other things in. - Indent the inside tags a little, so the nesting is easy to read.

English
<div>
<h2>My card</h2>
<p>Some text inside the box.</p>
</div>
English
Common mistakes
- Tags must nest, not overlap:
<b><i>x</i></b>, never<b><i>x</b></i>. - A comment is
<!-- ... -->and is ignored by the browser.
English
Now you try
- Comments help you stay organised; nesting builds structure.
- Leave a comment, then nest a paragraph inside a
<div>.
Исследовать
Neat nesting = the tree
Indentation in your HTML mirrors the parent/child tree.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Leave a note for yourself. Add a comment, like <!-- TODO: add a photo -->.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Put the paragraph inside a box. Wrap it in a <div> … </div>.
Сложность 1/5 · 100 монет + небольшой бонус за первое завершение сегодня
Group the recipe. Put the <h2> и the <ul> together inside one <div>, and indent them inside it.