- Create a
header
including navigation and branding. - Nest HTML elements to create well-organized, structured content.
Open index.html
in your text editor. You'll see the code that we wrote in the previous lab. In this lab, you're tasked with extending that well-formed HTML template with a navigation header, in the process practicing how to nest HTML elements to create a structured document.
First, add a set of header
tags inside the document body
to enclose the site navigation and branding. Inside the header
, we're going to add two things: a nav
to house our site navigation links and an h3
to serve as the branding for our site. Start by creating opening and closing nav
tags, and inside those create an u
nordered l
ist. Inside the ul
, add a pair of nested li
st elements to represent the other pages of the site. Finally, below the nav
(but still inside the header
), add an h3
containing the site's name, which can be whatever you like!
You can run the tests with this lab via learn
. Make sure you save the file before running the test suite. Failing tests will provide helpful error messages that you can use to debug your code — read them closely for hints!
While working through these assignments, your general workflow should center on writing code in the text editor and periodically running the test suite in the terminal to check your work.
Another great way to track your progress is to open up the HTML document in your browser and watch how each change you make in the text editor affects the visual layout in the browser. If you're using a local development environment, you can open the HTML file directly in your browser. If you're coding in the Learn IDE, check out this Help Center article that explains how to spin up and connect to a simple remote server.
Once you have the HTML document open in your browser, you can make changes to it in the text editor, save the file, refresh the page in the browser, and see the changes instantly.