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

ID selector not working in code challenge

I am trying to set the top border width for this CSS code challenge, but when I attempt to call out the ID "copyright", the system is recognizing this as a HEX value and will not let me continue. My code looks like the following:

  #copyright {

     border-top: 8px;

  }

When I go to check my work, I get prompted that I need to use the "#" symbol which I am clearly doing. Am I totally oblivious to something here? Has anyone else had this problem?

7 Answers

Hi, I think you need to set a style and color as well as a width in order for the border to show. For example

#element { border-top: 5px solid #000; }

Hope that helps!

EDIT: Don't know whats going on with the formatting sorry!

I forgot to include that with my post. I included the color in the actual challenge and it still is recognizing #copyright as a HEX value.

James Anwyl. I edited your code for you. Notice that I used ``` as opposed to '''. Check out this post for a good explanation on how to type code in the forum.

EDIT I just saw Gary Mann's post. Hopefully the forum post will still help.

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

You must've left something out, maybe the declaration that the border is solid? When you complete the challenge, It gives you a chance to share feedback. I'd share that the error message was off-base and confusing.

Hey James, are you using the single quote to try to post code? (I did that before I figured it out; this Markdown Cheatsheet is more confusing than some of the class material here.) It's three backticks (next to the number 1 on most keyboards. I had never used a 'backtick', and I had to google it to find out what it is, only to feel silly for not knowing.).

test {
color: #000;
}

specifically what code challenge is this from?

It is the last code challenge in stage 4 of the "Build A Simple Website" project in the Web Design track.

Hmm...I've just gone back through and it let me complete the challenge. Do you mean its recognising it at a hex value because of the syntax highlighting? As in its highlighted purple just like the hex values in color:?

I've taken a screenshot of my code, this is from the final stage though so spoiler warning CSS Challenge

That's exactly what it's doing. Its highlighting "#copyright" purple color, like it does for hex values.

Ah, well I think that's just a coincidence or the way the editor is built. It seems to be the same syntax highlighting for other challenges as well. I can see how you'd find that confusing though, maybe give that as feedback?

If you're still stuck post your complete code and I'll see if I can spot anything

lol yeah that's exactly was I was doing. Thanks dude

I got it to work. It still showed the ID selector as purple, but I typed in the exact same code as before when it wasn't letting me continue, so I'm not sure what was so different about this. Anyways, thanks for all of the help guys!

No problem, think its just the way the editor has been set up, it'll probably look like that in future challenges but now you know so shouldn't be a problem. Congrats anyway!