Exercises: Content and Structure
In this lesson, our content gains structure! Let's begin!
HTML defines a few dozen markup elements. Most of them define content, while other elements define logical containers. For example, the <h1>
elements define the content and the markup that signs that the content within should be rendered as a first-level heading.
In contrast, the <section>
element is a logical container. It tells the browser that the nested content defines a section of the document (e.g., a sidebar, a part of a chapter, etc.).
Inline and block content
The elements that provide content can be inline or block elements.
Inline elements render their content so that the content goes on the same “line” as the previous markup, while block elements start a new block from the beginning of a new line.
To make it easier to understand, Exercise 02-02 shows a simple example of inline and block elements:
Get hands-on with 1400+ tech skills courses.