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 Build a Simple Website Styling Content Finishing the CSS

Joshua Phillips
Joshua Phillips
7,237 Points

ID 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

I 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
Joshua Phillips
7,237 Points

Oops. 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?

Can't see your code but it would look like below

    #copyright {
           // Style rule here
    }

So I think the rule was something like this

    border-top: solid 8px #somecolor // Forget the colour now

Does this make sense?

Joshua Phillips
Joshua Phillips
7,237 Points

Yeah, 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
Joshua Phillips
7,237 Points

Never mind. I got it working. Thanks for your help!

So 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

    #copyright {
         border-top: solid 8px #2a0400;
    }

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.

    "```css"
        rules
    "```"
Joshua Phillips
Joshua Phillips
7,237 Points

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?