Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Build a Simple Website Creating a Website Structure Using Classes

Solving this HTML CSS code problem

<body> <div class="container clearfix"> <div class="grid_5 omega"> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </div> </div> </body>

May I know what's wrong with my code? I keep getting stuck at this stage and not know what is wrong with this code. I'm suppose to add the classes "grid_5" and "omega" to the featured cupcake. Please help.

Thanks.

Regards, Iris

2 Answers

Notice that the div already has an ID to it, so remember to not add the classes there, but instead add the attribute "class" and then add the classes there - separating "grid_5" and "omega" with a space to add multiple classes. You should end up with this:

<div id="featured-cupcake" class="grid_5 omega">

It seems I can't add the code itself (new to the forum), but I hope you understand what I'm saying. If not, let me know :-)

Hi Mikkel,

Thanks for your reply. But I'll have to type out my problem here so it'll explain better.

This is what I've typed out in the HTML CSS code challenge but it keeps saying that there's a mistake at the part where I have to add in the classes for "grid_5" and "omega" I've checked it many times but still do not know what is wrong:

<body> <div class="container clearfix"> <div class="grid_5 omega"> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </div> </div> </body>

Can you help me spot the mistake? Thank you very much.

Regards, Iris

Hi Mikkel,

Thanks for your reply. But I'll have to type out my problem here so it'll explain better.

This is what I've typed out in the HTML CSS code challenge but it keeps saying that there's a mistake at the part where I have to add in the classes for "grid_5" and "omega" I've checked it many times but still do not know what is wrong:

<body> <div class="container clearfix"> <div class="grid_5 omega"> <div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <img src="img/featured-cupcake.jpg"> </div> </div> </div> </body>

Can you help me spot the mistake? Thank you very much.

Regards, Iris

Hi Iris

I cannot see any code, if you were trying to paste it in. I have found out via the 'Markdown Cheatsheet' link below the comment section, that you need to mark your code with three so-called backsticks; ```

The code you should end up with is:

<div id="featured-cupcake" class="grid_5 omega">

Just tested it in the challenge and it works for me - hope it works with you too.