Main Content and Sections

Now let's take care of the middle of the page. Each of our three div elements is a part of the content on one topic, with its own heading, so they should be section elements. To turn a div into a section, we change both its opening and its closing tag. The attributes stay:

<section id="breeds">
	<h2>Breeds</h2>
	...
</section>

All the main content of the page then goes into the main element. A page has only one main, and the parts that repeat on other pages of the website, such as the header, the navigation or the footer, don't belong in it.

So when do we still use a div? When we only need to group elements together, for example to style them, and the group has no special meaning.

Instructions

Change the three div elements into section elements. Change both the opening and the closing tags and keep the id attributes.

Wrap the three sections and the video in a main element. It starts right after the second nav (the one with the table of contents) and ends just before the footer.

Start programming for free

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

Or sign up with:

11/12