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

Viraj Joshi
Viraj Joshi
2,815 Points

Selected class

Why does he keep cutting it(class=".selected" into the new image?

1 Answer

Andrew Nguyen
Andrew Nguyen
1,250 Points

He isn't cutting and pasting it onto a new image. He's assigning a class to the navigation links (portfolio, about, contact)

This is so he can edit the navigation links in the main.css file, to tell the user which page they are on.

If you look in main.css, at the very bottom you will see:

/* nav link */
nav a.selected, nav a:hover {
  color: #323f67;
}

nav a.selected chooses the 'nav' element, then the 'a' element with the class="selected" which turns it to the color #323f67 (blue)

So when you look at porfolio page, portfolio link is blue.

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

In about page, about link is blue

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

In contact page, contact link is blue

<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>
Viraj Joshi
Viraj Joshi
2,815 Points

Very detailed reply I get it now Thank you so much