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 trialJoshua Phillips
7,237 PointsID Selector not working
This syntax is not working for the ID selector:
#copyright {
In the online text editor, this turns pink like a color number rather than grey like I expected from the videos.
Thanks for any help.
2 Answers
Adam Sackfield
Courses Plus Student 19,663 PointsI believe this is just the colour for ID's in the online editor for tests, like the CLASSes turn orange and normal element selectors turn grey. Any difference noticed from the video are due them using Sublime Text and then this can have different syntax highlighting colours depending on the theme used.
Joshua Phillips
7,237 PointsThanks. Yeah, that could be the case. I'm still stuck though, because I can't get past the challenge. It wants me to add an ID selector for a copyright ID, so I put the above (#copyright {
), but it says I'm wrong. Any thoughts?
Joshua Phillips
7,237 PointsJoshua Phillips
7,237 PointsOops. Guess my comment was supposed to go here.
Thanks. Yeah, that could be the case. I'm still stuck though, because I can't get past the challenge. It wants me to add an ID selector for a copyright ID, so I put the above (
#copyright {
), but it says I'm wrong. Any thoughts?Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsCan't see your code but it would look like below
So I think the rule was something like this
border-top: solid 8px #somecolor // Forget the colour now
Does this make sense?
Joshua Phillips
7,237 PointsJoshua Phillips
7,237 PointsYeah, that makes sense. That's pretty much what I have. I'm not sure how to include the code image like you did in the previous comment, but here's what have:
#copyright { border-top: 8px; color: #2A0400; }
Joshua Phillips
7,237 PointsJoshua Phillips
7,237 PointsNever mind. I got it working. Thanks for your help!
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsSo close. After the 8px remove the ";" after the color remove the "color:" and it will pass. You only add the "color:" if your targeting the color as you have targeted border-top(if that makes sense, if not tell me and I will try be clearer). As for the ";" after 8px this is telling the browser that this rule is over so should only be added at the end of a line. Also you forgot the "solid" Full answer below
As for adding the nice markdown styling in the forum there is a link under each comment box. But what you need is an empty line followed by 3 "`" (not sure the name but its to the left of the top 1 on my keyboard) then the language "css" then new line add the rules with 4 spaces to indent then new line and 3 more of those tick things that started it off.