The larger the text, the more often it is divided into logical sections. For example, the basic markup of a report, diploma or essay consists of three main parts:
Such logical divisions into headings allow you to navigate faster in the document and find the part you need.
To create titles used 6 paired tags: <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, where <h1>
— title of the first level, the most important and describes the main subject of the text, and <h6>
— the title of the lowest level.
<h1>Title of the first level</h1>
<h2>Title of the second level</h2>
<h3>Title of the third level</h3>
<h4>Title of the fourth level</h4>
<h5>Title of the fifth level</h5>
<h6>Title of the sixth level</h6>
Each lower level heading is a subsection of a higher level heading. This is very similar to the table of contents of any book, the structure of which might look like this:
<h1>The best book on earth</h1>
<p>Description of the book. Thanks to my cat and my two dogs. Meow!</p>
<h2>Chapter 1</h2>
<h3>Part 1</h3>
<p>Paragraph with text</p>
<p>Paragraph with text</p>
<h3>Part 2</h3>
<p>Paragraph with text</p>
<p>Paragraph with text</p>
<h4>Notes</h4>
<p>The text of this note is written with love</p>
<h3>Part 3</h3>
<p>Paragraph with text</p>
<p>Paragraph with text</p>
<h2>Chapter 2</h2>
Add a first and second level header with arbitrary text in the editor
Follow the sequence of headings. Don't skip levels
There is usually only one first level header on the page
If you've reached a deadlock it's time to ask your question in the «Discussions». How ask a question correctly:
Tests are designed so that they test the solution in different ways and against different data. Often the solution works with one kind of input data but doesn't work with others. Check the «Tests» tab to figure this out, you can find hints at the error output.
It's fine. 🙆 One task in programming can be solved in many different ways. If your code passed all tests, it complies with the task conditions.
In some rare cases, the solution may be adjusted to the tests, but this can be seen immediately.
It's hard to make educational materials that will suit everyone. We do our best but there is always something to improve. If you see a material that is not clear to you, describe the problem in “Discussions”. It will be great if you'll write unclear points in the question form. Usually, we need a few days for corrections.
By the way, you can participate in courses improvement. There is a link below to the lessons course code which you can edit right in your browser.
Your exercise will be checked with these tests:
1const { test } = require('tests');
2
3test(({ query, expect }) => {
4 const h1 = query(document, 'h1');
5 expect(h1).to.be.visible;
6
7 const h2 = query(document, 'h2');
8 expect(h2).to.be.visible;
9});
10
Teacher's solution will be available in: