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
Pedro Lucas Da Silva Cunha
5,276 PointsYou bake me Blush alignment
Hey guys. Just need some help getting unstuck. I had a little issue after the grid markup. Once I followed the instructions to include the grid alignments I moved on to the next step, giving the background an image/color. I finally got the image to load (had some files in the wrong spot) but now my grid alignment is off. I can't get the "You bake me blush" image over to grid 3 (omega), which is the top right. Maybe I missed something.
Code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" context="text/html; charset=utf-8"/>
<title>Smells Like Bakin' Cupcake Company</title>
<link href="normalize.css" rel="stylesheet" type="text/css"/>
<link href="grid.css" rel="stylesheet" type="text/css"/>
<link href='http://fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="container clearfix">
<div class="grid_3 omega">
<img src="img/logo.gif" alt="Smells Like Bakin">
</div>
<div class="grid_8 omega">
<ul class="nav">
<li><a href="#">About</a></li>
<li><a href="#">Cupcakes & Prices</a></li>
<li><a href="#">Locations</a></li>
<li class="last"><a href="#">Contact Us</a></li>
</ul>
</div>
<div id="intro" class="grid_9">
<h1>Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious desserts.</h1>
<p><a href="#" class="btn">Browse Our Cupcakes</a></p>
</div>
<div class="grid_10 omega">
<img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">
</div>
<div id="featured-cupcake" class="grid_7">
<h2>Cupcake of the Week</h2>
<p>This week's featured cupcake is the <a href="#">Avocado Chocolate Cupcake</a>. Its strange combo of flavors will kick your taste buds into fiest mode!</p>
<img src="img/featured-cupcake.jpg" alt="Avocado Chocolate Cupcake">
</div>
<div id="new-cupcakes" class="grid_5 omega">
<h2>Fresh Out the Oven</h2>
<p>Our newest cupcakes are <a href="#">Bacon Me Crazy</a> and <a href="#">Jalapeno So Spicy</a></p>
<img src="img/new-cupcake-bacon.jpg" alt="Bacon Me Crazy">
<img src="img/new-cupcake-jalapeno.jpg" alt="Jalapeno So Spicy">
</div>
<div class="grid_7">
<h2>Inside the Kitchen</h2>
<p>Smells like Bakin' started out in the garage of the husband wife duo Allison & Joseph. Allison is the baker, and Joseph found a way for them to make a business out of her tasty treats. Flash forward to today and they have a successful store front, catering business and cupcake truck. </p>
</div>
<p><a href="#" class="btn-small">Read More</a></p>
<div class="grid_5 omega">
<h2>Get Bakin' with Us</h2>
<div id="contact">
<p>Call us:<span> 1-555-CUP-CAKE</span><br>
Email us:<a href="#">bakeon@smellslikebakin.com</a></p>
</div>
<p>We annouce all of our new flavors first through Facebook & Twitter, and even take requests!</p>
<a href="http://www.facebook.com/SmellsLikeBakin"><img src="img/facebook.gif" alt = Facebook></a>
<a href="http://www.twitter.com/#!/smellslikebakin"><img src="img/twitter.gif" alt = Twitter></a>
</div>
<div id="copywright" class="grid_12">
<p>© 2012 Smells like Bakin' Cupcake Company. All Rights Reserved.</p>
</div>
</div>
</body>
</html>
3 Answers
Pedro Lucas Da Silva Cunha
5,276 PointsNevermind, fixed. Just manually changed the margin of the neighboring element by adding this code to the style.css:
intro {
margin: 50px 0 75px 0;
}
Justin Horner
Treehouse Guest TeacherHello Pedro,
I see that you have solved your problem by setting a margin. I would like to offer a few changes to the HTML that you posted that should allow your design to be corrected without setting a margin. I offer this in hopes that it will allow you to avoid similar problems as you continue through the lessons. Feel free to disregard this answer if you have moved on.
The first potential problem is the grid classes used for the first two grid divs. Since we have twelve columns available to us, we want the logo and navigation to use all twelve in the first row. To do this, we would use the grid_4 class for the first div (logo) and both the grid_8 and omega classes for the second div (navigation). What you end up with is the following.
<div class="grid_4">
<img src="img/logo.gif" alt="Smells Like Bakin" />
</div>
<div class="grid_8 omega">
<ul class="nav">
<li><a href="#">About</a></li>
<li><a href="#">Cupcakes & Prices</a></li>
<li><a href="#">Locations</a></li>
<li class="last"><a href="#">Contact Us</a></li>
</ul>
</div>
The next issue is the “You Bake Me Blush” image div class. It is currently set to grid_10 omega which causes it and the div above it go over twelve columns. Instead what we want is “grid_3 omega”. The div before it (grid_9) and grid_3 omega will create one row of twelve columns. This looks like the following.
<div id="intro" class="grid_9">
<h1>Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious deserts.</h1>
<p><a href="#" class="btn">Browse Our Cupcakes</a></p>
</div>
<div class="grid_3 omega">
<img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush" />
</div>
Also, the “Read More” paragraph/link is outside of the grid_7 div. Please place this inside the grid_7 div after the paragraph like so.
<div class="grid_7">
<h2>Inside the Kitchen</h2>
<p>Smells Like Bakin’ started out in the garage of the husband wife duo Allison & Joseph. Allison is the baker, and Joseph found a way for them to make a business out of her tasty treats. Flash forward to today and they have a successful store front, catering business and cupcake truck.</p>
<p><a href="#" class="btn-small">Read More</a></p>
</div>
I hope this helps.
Pedro Lucas Da Silva Cunha
5,276 PointsThank you so much for your insight Justin. I made those changes, not surprised when it helped format the page a little better. House keeping helps keep the code clean. Thanks bud. Cheers.
Justin Horner
Treehouse Guest TeacherYou're welcome! I'm glad I could help.