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 trialDavid Miller
3,526 PointsThe background of my font in "nav a" has turned orange just like in the video; however, the text has remained blue. ??
code is identical to instructors
4 Answers
Ben Ragsdale
14,187 PointsHi David,
That's right, CSS doesn't use that form of commenting.
CSS uses the following format for comments: /* put comment here */
Trent Hayes
9,899 PointsComments in CSS begin with /* and end with */
for instance,
/* This line is commented out. */
David Miller
3,526 PointsI just rewrote it and figured out the problem was a comment I made. Care to clarify why?
Here is the code that works:
<style>
nav a {
color: white;
background-color: orange;
}
</style>
Here is the code that will only change the background-color:
<style>
nav a { <!-- style -->
color: white;
background-color: orange;
}
</style>
**I assume the problem is that CSS doesn't use the same commenting technique as HTML and is commenting out the first property...
Andrew Stelmach
12,583 PointsIt won't be. Post your code up here.