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

General Discussion

When changing the pixels to percentages in grid.css

When I changed the pixels to percentages in grid.css, my smellslikebakin website lost its side margins and is now directly against the side of the webbrowser. Why did this happen?

3 Answers

Create a codepen so we can see what you mean

Here is my codepen for my html and style.css :http://codepen.io/anon/pen/xHzyr

Maybe I can clarify my question. The container that originally made the website look centered on the web browser and give it a max width, now appears to be gone.

The website content now begins directly on the left margin. I compared my grid.css with the project file and they seem to be the same. I can't figure out why this is happening.

Below is a copy of my grid.css.

/*
 Width: 1000px
 # Columns : 12 
 Column width: 65px
 Gutter : 20px 

 */
.grid_1 { width: 6.5%; }
.grid_2 { width: 15%; }
.grid_3 { width: 23.5%; }
.grid_4 { width: 32%; }
.grid_5 { width: 40.5%; }
.grid_6 { width: 49%; }
.grid_7 { width: 57.5%; }
.grid_8 { width: 66%; }
.grid_9 { width: 74.5%; }
.grid_10 { width: 83%; }
.grid_11 { width: 91.5%; } /*915px*/
.grid_12 { width: 100%; }

.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 2% 1% 0; /* 0 20px 10px 0*/
    float: left;
    display: block;
}

.alpha{margin-left:0;}  /*0px*/
.omega{margin-right:0;} /*0px*/

.container {
    width: 90% /*90%*/
    max-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}

Hi James, I figured it out. My computer saved the document as a text file instead of an HTML file. Once I changed that, it fixed the style issues. Thanks,

Matt