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
Kimberly Mihayo
876 PointsIssues with container divs and margins
After applying container divs to my code my margins still haven't changed. Checked and rechecked the code, not sure what the problem is.
4 Answers
Kimberly Mihayo
876 PointsThanks! I finally got it to work. I think it was because I put my index.html file together with the grid.css and normalize.css files (in a css folder). Somehow this was messing with the code in the html file, so I put it on my desktop and the margins came back.
Adam Sackfield
Courses Plus Student 19,663 PointsWhat do you mean the margin's have not changed. I assume your container class looks something like this
.container {
width: 60em;
margin: 0 auto;
}
This should have an even margin either side.
Kimberly Mihayo
876 PointsI'm using
.container{
width: 1000px;
margin: auto;
which is from the grid.css file that was given in the "Working with Grids" portion of web design, and I applied
<div class="container>....</div>
within the body. But my margins won't appear. My page is still leaning to the far left.
Kimberly Mihayo
876 Pointsoh, sorry my container div code is
<div class="container">....</div>
Adam Sackfield
Courses Plus Student 19,663 PointsHave you also included th link to the grid.css file correctly?
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsWhen telling the browser where a file is going to be using the <link> tag ensure it knows what folder to look in like
<link src="css/grid.css">Also if ou choose a best answer so people can see this is solved