Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

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

  1. 1

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

  2. 2

    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.

Back

13/14

  1. 1. Attributes
  2. 2. Links
  3. 3. Quiz: Links
  4. 4. Opening Links in a New Tab
  5. 5. Relative Links
  6. 6. Images
  7. 7. Quiz: Images
  8. 8. Image Accessibility
  9. 9. Videos
  10. 10. Images as Links
  11. 11. In-Page Links
  12. 12. Page Structure
  13. 13. Main Content and Sections
  14. 14. Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.