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 Build the Contact Page

contact page displays portfolio page instead about page

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Sylvia Jung | Artist</title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,800,700italic|Ubuntu:400,700,400italic' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <a href="index.html" id="logo"> <h1>Sylvia Jung</h1> <h2>Artist</h2> </a> <nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li>
<li><a href="index.html" class="selected">Contact</a></li> </ul> </nav> </header> <div id="wrapper">

When I click on the contact link I see the portfolio page and the portfolio link is still active (green) instead of turning white. What happened?

Brenna Leker
Brenna Leker
7,596 Points

Hi Sylvia, You need to change your last hyperlink to "contact.html" instead of "index.html"

<li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li>
<li><a href="contact.html" class="selected">Contact</a></li> </ul> I hope this solves your problem :) Brenna

6 Answers

Hi Brenna, I appreciate all your help, thank you! The root of the problem was the issue you pointed out in your first response, that the contact link had mistakenly the a ref=index.html . I just realized, that I had carried this mistake over from the index.html to the about.html and finally the contact.html file, probably messing this up already in the beginning while copying and pasting lines. After I corrected it in all three files it worked, hooray! Sylvia

Thanks a lot for your help, Brenna, amazing that I did not see this!!! Unfortunately it did not change anything about the problem which is odd. So the code looks mow like this: <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li>
<li><a href="contact.html" class="selected">Contact</a></li> </ul>

Brenna Leker
Brenna Leker
7,596 Points

You are missing a closing head tag after your stylesheet links and an opening body tag before <header>

Thanks so much for helping again, Brenna! I am somewhat confused though, about the missing tags...(I don't see them) I had copied the whole about.html file and that page works just fine, the only thing I had changed in the contact.html was the selected navigation item

Brenna Leker
Brenna Leker
7,596 Points

Hi Sylvia, from the HTML you posted it looks like you are missing some tags(head and opening body tag) towards the top of the document.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Sylvia Jung | Designer</title>
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/normalize.css">
</head>
<body> 
<header>
  <a href="index.html" id="logo">
  <h1>Sylvia Jung</h1>
  <h2>Artist</h2>
  </a>
  <nav>
   <ul>
     <li><a href="index.html">Portfolio</a></li>
     <li><a href="about.html">About</a></li>    
     <li><a href="index.html" class="selected">Contact</a></li>
    </ul>
  </nav>
</header>
<div id="wrapper">
Brenna Leker
Brenna Leker
7,596 Points

I'm glad to hear it! Happy coding.