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

CSS How to Make a Website Adding Pages to a Website Add a New Page

jennifer ray
jennifer ray
7,875 Points

About page not linked?

I must have typed my code wrong somewhere and cannot find it. I do not have no about page linking. My code is below.

https://teamtreehouse.com/workspaces/5266932

Hey Jennifer,

Try linking to a snapshot of your workspace because that URL is not a URL you can share, unfortunately. It's specific to you. Here's how to post a snapshot: http://www.teamtreehouse.com/forum/workspace-snapshots

5 Answers

Hey Jennifer,

I immediately saw the issue when I opened up the snapshot haha In the href of the anchor link for the "About" page it says "index.html" when it should say "about.html".

      <li><a href="index.html"class="selected">Portfolio</a></li>
        <li><a href="index.html">About</a></li>
        <li><a href="index.html">Contact</a></li>

should at least be:

      <li><a href="index.html"class="selected">Portfolio</a></li>
        <li><a href="about.html">About</a></li>
         <!-- contact.html is the temporary name for your future contact page :) -->
        <li><a href="contact.html">Contact</a></li>
jennifer ray
jennifer ray
7,875 Points

Of course it should cause a href is the link to the pages. Silly of me, not good studying when tired. Many thanks for your quick response.

You are many welcomes! :D

jennifer ray
jennifer ray
7,875 Points

I do have another question if you could help me with? What does the attribute class selected mean?

No problem, Jen. I think you know that the class attribute gives the element a class of course. That name "selected" is used, in this case, for a certain style to show that the selected link is the page we're currently on. For example, in the index page, you can notice that the "portfolio" page (aka index) has the class of selected. Whenever an "a" element within the "nav" element gets the class selected, it gets this style from your "main.css" stylesheet (at the very bottom of the stylesheet). This style also applies to links within the nav element when the mouse hovers over them:

nav a.selected, nav a:hover {
  color: #000;
}

This style is to distinguish which page we're currently on by sight on the page because it will appear as black unlike the other links in the navigation.

jennifer ray
jennifer ray
7,875 Points

fantastic explanation I understand now, thank you Anymore questions I have will be coming your way :)

Anytime you wish, Jennifer! haha Happy Coding!