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 trialViraj Joshi
2,815 PointsSelected class
Why does he keep cutting it(class=".selected" into the new image?
1 Answer
Andrew Nguyen
1,250 PointsHe 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
2,815 PointsViraj Joshi
2,815 PointsVery detailed reply I get it now Thank you so much