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

Alice Barton
Alice Barton
1,053 Points

Stuck on task: "creating a website structure"

It is easy enough to get the first part of the task right, but when it asks me to "Add the classes 'grid_5' and 'omega' to the 'featured-cupcake' element.", and I do it, it then says that the first part of the task is now incorrect. I tried playing with where the </div>'s were, and not having any luck. Please help!

9 Answers

Alice Barton
Alice Barton
1,053 Points

Ahhh Wayne! That's it! I didn't know you could put the class right next to the div id. Thanks!

Wayne Priestley
Wayne Priestley
19,579 Points

Alice, This should help you to see what you need. http://codepen.io/Just-Wayne/pen/JqlFh

When you add multiple classes to an html element they are separated by a space with in the quotes. Example:

class="grid_5 omega"

You shouldn't have two class attributes on the same element and these class can't be in the id attribute.

Hope that helps.

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Alice, as Bryan said, But i just wanted to add the div id so you see the whole thing. div id="new-cupcakes" class="grid_5 omega"

Alice Barton
Alice Barton
1,053 Points

Hi Bryan, I'm not sure you understood my question. After adding another line with the div class "grid_5 omega" underneath the div class "container clearfix", and having 2 "/div"'s at the end, it doesn't work. I think at this point it would be nice to just get a screenshot of the answer to avoid further frustration. On that note, there should be an option in the program to do this anyway, or at least to give some hints when you get stuck.
Thanks, Alice

Jon Sultana
Jon Sultana
6,916 Points

I had the same problem where it would time out and my first answer was no longer valid. Just keep trying it should eventually work.

Good luck!

Can you copy and paste your code? It's hard to troubleshoot without actually seeing it. :)

Jon Sultana
Jon Sultana
6,916 Points

Here is the answer.

<div class="container clearfix">
    <div class="grid_5 omega">

    </div>
</div>
James Barnett
James Barnett
39,199 Points

Jon Sultana - Remember our goal on the forum is give help not answers, next time try giving an explanation and/or a hint instead.

Need more explanation on the distinction check this out.

Alice Barton
Alice Barton
1,053 Points

James, you make a good point that in teaching, you should refrain from giving the answers, as it often prevents learning from happening. However, in this case, and I bet that often when you are working in code, it is impossible to explain the problem and give adequate help when you can't type in the code you are having issues with. Ironically, in this case, Jon's answer did not help at all, and I instead referred to Wayne's helpful link.

As I remarked earlier, I think that perhaps the program itself should be giving hints (and/or answers when a finite number of wrong attempts are made) instead of users having to rely on the forum for help, where it is sometimes difficult to describe the issue. Right now the program attempts at giving hints, but most of the time it simply tells you when something is wrong, leaving the user to guess what it is.

James Barnett
James Barnett
39,199 Points

Alice Barton -

These topics get discussed quite a bit here on Treehouse, I've linked to a few threads you might find interesting.

> I bet that often when you are working in code, it is impossible to explain the problem and give adequate help when you can't type in the code you are having issues with

You can either type code in the forum using markdown or use codepen to create a demo

> I think that perhaps the program itself should be giving hints (and/or answers when a finite number of wrong attempts are made) instead of users having to rely on the forum for help

This thread has an interesting dicussion about it.

Do code challenges need hints

Wayne Priestley
Wayne Priestley
19,579 Points

I get what your saying James, i had tried to explain it using code but it just didn't display correctly. I'll take your advice next time, will also work on how i input code into a post, thanks for the link.