Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Two questions on using the <nav> and <ul> elements

1) In the first course of the “Front End Web development” track, called “How to Make websites”, under the subsection called “Creating HTML Content” and under that subsection, the sub-subsection called “Use the Navigation Element” How come the below code was not placed inside of the <nav> element?

<a href=”index.html”> <h1>Nick Pettit</h1> <h2>Designer </h2> </a>

2) Also, how come the above code was not placed inside of the <ul> element either?

Thanks for answering my questions.

Yes, that's an interesting question and a reasonable one.

The thing is I don't want to be a spoiler and tell you the whole thing that will come later, but just as a hint, the headers 1 and 2 will act as such (and additionally also link to the home page), but they will not act as navigation bar (or be part of it), never but even more especially on mobiles.

However, later in the course you will see how he creates the actual navigation bar you refer to linking to the other pages. And he will do so just like you said in your question, so for now just follow along, and you'll see.

1 Answer

Hi Nico, Can you please response to my second question as well. I asked two questions. My comment regarding your comment on my first questions is that even later on in the course, clicking on the two headlines do take us back to the homepage. So as a result, those two paragraphs in the head line should be part of the nav element. I don’t know why they are not.

My second question was: <a href=”index.html”> <h1>Nick Pettit</h1> <h2>Designer </h2> </a> 2) Also, how come the above code was not placed inside of the <ul> element either? After all the <a> element contains two items(two head line). Wouldn’t that make it a list?

Thanks