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 trialPravin Boteju
230 PointsTrouble with grid.css
I am currently on the video "Working with Grids." I downloaded the zip file from the page and opened the normalize.css and grid.css files on Sublime Text 2. Now when I tried to add the <div class="container"> command to access .container from grid.css, the command does not show up when I refresh my web page.
Any help would be awesome.
15 Answers
Brandon Barrette
20,485 PointsClick the markdown cheatsheet below the textbox for the rules. You can either tab in 4 times for 1 line, or use three tick marks ``` to start and end code. Use HTML and CSS next to the first set of 3 tickmarks to syntax highlight the code.
Brandon Barrette
20,485 PointsHave you made sure to include the stylesheets in your HTML file? You'll need this in the header:
<link rel="stylesheet" type="text/css" href="normalize.css">
<link rel="stylesheet" type="text/css" href="grid.css">
Pravin Boteju
230 PointsThanks for the reply.
And yes, both of the stylesheets are included in my file.
Brandon Barrette
20,485 PointsCan you past in your html? and your css for .container
Pravin Boteju
230 Points'''html <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Smells Like Bakin' Cupcake Company</title> <link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen"> <link rel="stylesheet" href="css/grid.css" type="text/css" media="screen"> </head> <body> <div class="container"> '''
Pravin Boteju
230 PointsI'm still trying to figure out how to paste my HTML on here haha...
Pravin Boteju
230 Points<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen"> <link rel="stylesheet" href="css/grid.css" type="text/css" media="screen"> </head> <body> <div class="container">
Pravin Boteju
230 PointsHow did you get that nice gray box with the code in it?
Pravin Boteju
230 Points<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Smells Like Bakin' Cupcake Company</title>
<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
</head>
<body>
<div class="container">
Pravin Boteju
230 Points.grid_1 { width: 65px; }
.grid_2 { width: 150px; }
.grid_3 { width: 235px; }
.grid_4 { width: 320px; }
.grid_5 { width: 405px; }
.grid_6 { width: 490px; }
.grid_7 { width: 575px; }
.grid_8 { width: 660px; }
.grid_9 { width: 745px; }
.grid_10 { width: 830px; }
.grid_11 { width: 915px; }
.grid_12 { width: 1000px; }
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11,
.grid_12 {
margin: 0 20px 10px 0;
float: left;
display: block;
}
.alpha{margin-left:0px;}
.omega{margin-right:0px;}
.container{
width: 1000px;
margin: auto;
}
.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0}* html .clearfix,*:first-child+html .clearfix{zoom:1}
Brandon Barrette
20,485 PointsI'm not sure what the issue is. The code look almost correct. You need to close both the container div and your body meaning you need:
</div> and </body>
What is it not doing correctly? What do you want it to do?
Pravin Boteju
230 PointsWell on the video it explains that once I refresh my browser, the page margins should center align, giving it a more balanced look. But when I click refresh, nothing happens. I'll sift through google some more and see what I can find. It might just be my Google Chrome Browser.
Brandon Barrette
20,485 PointsLook at my last answer. It wasn't formatted correctly and the html was missing. That might be your error.
Pravin Boteju
230 PointsOh yeah I have that in my code, I just didn't copy that part when I pasted into the comment box. Still not having much luck.
Brandon Barrette
20,485 Pointsgive me the whole html so i can view it on my browser.
Pravin Boteju
230 Points<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Smells Like Bakin' Cupcake Company</title>
<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
</head>
<body>
<div class="container">
<img src="http://i.imgur.com/D33By0w.gif" alt="Smells Like Bakin">
<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 id="intro">
<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>
<img src="http://i.imgur.com/xuRWB8F.gif" alt="You Bake Me Blush">
<div id="featured-cupcake">
<h2>Cupcake of the Week</h2>
<p>This week's featured cupcake is the <a href="#">Avocado Chocolate Cupcake</a>. It's a strange combo of flavors that will kick your taste buds into fiesta mode!</p>
<img src="http://i.imgur.com/Xu75IoS.jpg" alt="Avocado Chocolate Cupcake">
</div>
<div id="new-cupcakes">
<h2>Fresh Out the Oven</h2>
<p>Our newest cupcakes are <a href="#">Bakin Me Crazy</a> and <a href="#">Jalapeno So Spicy</a>. </p>
<img src="http://i.imgur.com/oxwqBw4.jpg" alt="Bacon Me Crazy">
<img src="http://i.imgur.com/TEFw73O.jpg" alt="Jalapeno So Spicy">
</div>
<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 succesful store front, catering business, and cupcake truck. </p>
<p><a href="#" class="btn-small">Read More</a></p>
<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 announce all of our new flavors first through Facebook & Twitter, and even take requests!</p>
<a href="http://www.facebook.com/smellslikebakin"><img src="http://i.imgur.com/cOHY7m0.gif" alt="Facebook"></a>
<a href="https://twitter.com/#!/smellslikebakin"><img src="http://i.imgur.com/BAz7gBM.gif" alt="Twitter"></a>
<div id="copyright">
<p>© 2012 Smells Like Bakin' Cupcake Company. All Rights Reserved.</p>
</div>
</div>
</body>
</html>
I appreciate the help!
Brandon Barrette
20,485 PointsWorks fine for me. Make sure you have your browser stretched open past 1000px. On my 12" laptop, that takes almost the entire screen to see it centered in the middle.
Otherwise, not sure what's happening.
Pravin Boteju
230 PointsGot it, thanks you da best.