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
Lanz Ceniza
4,419 PointsCreating a Website Structure CSS Using Classes
I am unable to figure out the code challenge which ask me to "Add a 'div' around the 'featured-cupcake' element and give it the classes 'container' and 'clearfix'." Can anyone help me and tell me what I did wrong?
<body>
<div class="container" class="clearfix">
<div id="featured-cupcake">
<h2>Cupcake of the Week</h2>
<img src="img/featured-cupcake.jpg">
</d>
</div>
12 Answers
Dan Ridley
Courses Plus Student 14,839 PointsHey Lanz,
I can sure try and help you out. Can you please post a link to the challenge you are talking about along with the task that is giving you trouble.
Talk to you soon
Dan
Lanz Ceniza
4,419 PointsThanks Dan
Here's a link to the challenge code that I am having trouble with. http://teamtreehouse.com/library/using-classes
Thank you
Dan Ridley
Courses Plus Student 14,839 PointsOk I see what you need to do. You need to create a div that will contain the other div with the id of "featured cupcake". Locate this div I just mentioned and you are going to create another div that contains it. Once you are created that div, give it the appropriate classes
Hope this helps. Let me know how it goes.
Dan
Lanz Ceniza
4,419 PointsI'm sorry it still didn't work out for me. I am new to html and css and I don't fully understand what div I have to create inside another div and giving it the appropriate class. I watched the video over and over again but I am missing something.
Thanks
Dan Ridley
Courses Plus Student 14,839 PointsOk I will show you an example of wrapping another div. The code below is an example div that is going to be contained by another div in a minute.
<div class="going to be contained">
<img>
</div>
I will now contain the div with another div.
<div class="container">
<div class="going to be contained">
<img>
</div>
</div>
The div with the class "going to be contained" is now contained by the div with the class "contained"
Let me know if this helps :-)
Lanz Ceniza
4,419 PointsIm still unsuccessful of solving it. Do you think you can show it in html terms? Like where to put them in another example.
Thank you
Lanz Ceniza
4,419 PointsCan you tell me what I did wrong here?
< div class="container" class="cleearfix > < div id="featured-cupcake" > < h2 >Cupcake of the Week</h2> <i mg src="img/featured-cupcake.jpg" > < /div > < /div >
Joseph Wachira
18,063 PointsLanz Ceniza I actually can't tell what you did wrong since you haven't posted your code here. Use Dan Ridley's example to figure out what it is you were missing.
You should arrive to this:
<div class="add-first-class-here add-second-class-here">
<div id="featured-cupcake">
<h2>Cupcake of the Week</h2>
<img src="img/featured-cupcake.jpg">
</div>
</div>
Replace "add-first-class-here" and "add-second-class-here**" with the respective classes
Happy coding :)
Riley Bracken
16,762 PointsIf I can remember right it should be this..
<div class="container clearfix">
<div id="featured-cupcake">
<h2>...</h2>
</div>
</div>
Hope that helps
Lanz Ceniza
4,419 PointsJoseph thank you so much for your help. It finally worked.
Joseph Wachira
18,063 PointsLanz Ceniza Also when you find time you can step up your game by going through this comprehensive guide dedicated to helping beginners learn HTML and CSS
Lanz Ceniza
4,419 PointsI will check it out to enhance my knowledge in html and css Joseph Wachira