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

Melissa Castle
Melissa Castle
15,560 Points

Stage 4 (finishing the CSS) in Build a Simple Website

I'm stuck on Task 1 of finishing the CSS (Stage 4) in Build a Simple Website - I get an error saying "Remember, to select an ID, use the '#' character followed by the ID of the element you want to select."

Here's what I put in:

copyright {

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

Am i missing something? Thanks, Melissa

6 Answers

zhuoyu zhu
zhuoyu zhu
9,806 Points

I just went back and checked that task. It seems that you're missing a property to specify.

The task is "give it a solid top border that is 8 pixels thick and has a color of #2A0400". However, according to your code, you didn't tell the ID selector that top-border is solid. That's why it gives an error to you.

So instead, you should type #copyright { border-top: 8px solid; border-color: #2A0400; } and there is also a shorthand to specify all the three properties in one line.

For instance, you can do #copyright { border-top: 8px solid #2A0400; } Then you are supposed to pass that challenge.

zhuoyu zhu
zhuoyu zhu
9,806 Points

if copyright is your ID, you should specify '#' in front of copyright. Try again!

Melissa Castle
Melissa Castle
15,560 Points

ah, yeah, I should have used some esacpes (I did have # in front of copyright): what I should have put is: CSS ```#copyright { border-top: 8px; border-color: #2A0400; }

So, this code is giving me an error when I try to have it checked.
Thanks,
Melissa
Melissa Castle
Melissa Castle
15,560 Points

yes, that was it thanks for the help. I guess the error was a little mis-leading.

James Barnett
James Barnett
39,199 Points

In the real world CSS has no built-in error functionality. So the Treehouse teachers took a few educated guesses at what might be tripping up a student in a code challenge.

I think of them as generic failure messages that alert me that my code has a bug.

To quote Matthew Campbell's post in another thread on the code challenges ...

> What's good with the challenges now is that they teach you to debug as well. if you've rewatched the video and are 100% the code on the page is correct, then there must be an error in your code. This teaches you to be accurate coding and to debug well. At the moment, we're dealing with 10 or 20 lines of code in a challenge. Imagine having thousands of lines of code and many many files. One error somewhere in that code can break the entire site.

Matt Campbell
Matt Campbell
9,767 Points

I'll reiterate this point James Barnett.

This site (http://ultimategamingparadise.com/) that I'm building and is probably less then half done currently has 2,612 lines of JUST CSS across 10 files.

One mistake, and who knows how long I'll be taking to find it and fix it.

Once you get onto the likes of PHP and especially functions in WordPress, debugging will become an important part of your day where you may find yourself spending a whole day trying to find and figure out a problem.

Learning to code can not be rushed, sometimes it helps to come back to it after a day away from it and take a fresh look.

James Barnett
James Barnett
39,199 Points

Yep :+1:

> Learning to code can not be rushed, sometimes it helps to come back to it after a day away from it and take a fresh look.

I had a programming teacher in college that used to say half of all computer problems can be solved by going to lunch.

Melissa Castle
Melissa Castle
15,560 Points

Thanks for the feedback. I definitely understand both the difficultly of debugging/picking out concise errors in a language meant for styling. And I do appreciate the opportunity to learn from this...I'll now to re-read and look closer next time. I did leave it from yesterday and came back to it today to try it again, but it still eluded me. Great program!

Matt Campbell
Matt Campbell
9,767 Points

I tend to find I'm working on two or three things at once simply so that I don't spend hours going in circles. Do two or three different pages, get bored or frustrated with page 1, do some work on page 2, then go back to page 1 when I have that light bulb moment or come up with the idea that will complete what I'm trying to do.

James Barnett
James Barnett
39,199 Points

Melissa Castle -

Here are my suggested steps for solving issues you are having while programming, not just useful for Treehouse but when you start making stuff on your own as well.

  • Re-watch the video, this time put away the text editor and take notes
  • Read through your notes

  • Read through the instructions (again)
  • Try answering the question again
  • Read your code backward (starting at the end of the line)

  • Explain what each line of your code does out load to a rubber duck or anything else sitting on your desk
  • Write down the question you have about the issue you are currently experiencing, when you are done read it your rubber duck

  • If you've been at this for about half an hour (atleast), post here on the forum

  • Your forum post should include the question as you formulated for your rubber duck

  • Also make sure you are helping us help you, here are instructions on how to ask good questions on the forum