6.1: Favorites HTML

Add a new section

In index.html we need to add another section for this "Favorites" portion of the webpage - again, we need to give the section an ID attribute so the link in our header will work. Just like we did during the "Facts" portion, let's use in-line-styling to give this section a light gray background

<section id="favorites" style="background-color: lightgray;">
  <h3>Favorites</h3>

</section>
Favorites Section

Create our table

We want to display our favorite movie, book, TV show, and song... and we can also display a few other good choices too... A good way to display this information is with a table.

  • Every table is wrapped in <table> </table> tags

  • Every row in the table is wrapped in <tr> </tr> tags

  • We can add table headers with <th> </th> tags

  • For the table data, we display each cell using <td> </td> tags

Table HTML
Table Result

Next Section

This table definitely needs some styling. Go to 6.2: Favorites CSS.

Last updated