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

What wrong this code? CSS.

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

challenge task 1 of 4: Instructions Select the copyright using an ID selector. Give it a solid top border that is 8 pixels thick and has a color of #2A0400.

Error I get: Bummer! Remember, to select an ID, use the '#' character followed by the ID of the element you want to select.

3 Answers

My bad, The code I posted doesn't work because it is adding a border to all sides of an element, whereas the challenge says you just need to add a top border.

Long way:

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

Shorthand way:

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

Hope this helps!

Thanks. That worked. I was so fixated on the error indicating the ID selector was wrong that I didn't even bother to check my properties. Lol.

Thanks!

EDIT: Didn't read your code properly so my answer was a bit misleading. Updated answer:

The long way of writing this is

#copyright {
   border-width: 8px;
   border-style: solid;
   border-color: #2a0400;
}

The shorthand way of doing it would be

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

Which declares the width, style and color all in one.

Hope this helps!

I tried copying and pasting your code, and got a different error. they want us to do it like in the lesson. I think there is something wrong with the testing code or something.

You have missed the ID selector from the beginning of copyright, remember to include the #

copyright

thanks. I had that, but I made a mistake in formatting my question for the forum. I corrected it so it displays the code.