Recap

In the second lesson, we learned that:

  • Headings are created with the elements h1 to h6 (h = heading). We choose the level by importance, not by size. h1 is the main heading of the page, and a page normally has only one.
  • Paragraphs are created with the p element (paragraph).
  • The div element (division) groups other elements together. It has no meaning of its own.
  • The strong element (strong importance) marks important text, and the em element (emphasis) marks text we stress. Browsers show them in bold and in italics. If text should only look bold or italic, without extra meaning, we use CSS.
  • The browser joins spaces, tabs and line breaks that follow one another in the code into a single space. That's why pressing Enter in the code doesn't start a new line on the page, and why indentation doesn't change how the page looks.
  • We start a new line with the br element (break), which has no content or closing tag. We use it only for line breaks that belong to the content, such as in poems or addresses, not to make space between texts.
  • Lists are created with the ol (ordered list) or ul (unordered list) element, and their items with the li element (list item).
  • Comments are written like this: <!-- comment -->. The browser doesn't display them.

In this lesson, we learned how to create the text content of web pages. In the next lesson, we will learn what attributes are, how to use links, and how to add media content such as images and videos.

Instructions

Congratulations on completing the second lesson! The editor contains your final code from this lesson, and we will build on it in the next lesson. Now you can try customizing the page with your newly acquired knowledge.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

8/8