I’m trying out a responsive layout, so my first step is to create a Logo and Navigation elements that scale correctly. I set them to float left, 25% and 75% of the page (1140 px), respectively. This renders fine in Firefox, but Chrome / Safari can’t get width correct and render the navigation a little short.
Ok, so here’s the weird part: set the page width to 960px and everything renders fine.
What is going on? (entire html file below)
You need to realize that not all browsers rounding capabilities are the same :). Some round up. Some round down.
Now lets analyze your page. You have a 25% sidebar width. 1140*.25 = a round whole number. No problems there.
Now lets take the other part of your page. 1140*.75=855px. Then you lay your list out in groups of 4 (via width:25%). 855/4=213.75px.
That’s not a whole number. Browsers will round up / down b ecause .75ths of a pixel can’t exist. If you do the math and update your page wrapper width to accomodate for percentages coming off with decimal places (get it so no decimal places exist!), then your problem will go away.