CSS Grids: Customize the Page Width
We've made it easy to customize the page width. pixels/13 = ems for all non-IE browsers. For IE, pixels/13.3333 = ems. (I find it useful to preserve up to four decimal places (1.2345) before rounding.)
This example shows three stacked divs, each with their own custom width applied. The first region is 400px wide, second is 500px, and the final region is 600px wide.
Customizing the Page Width
We've made it easy to customize the page width. pixels/13 = ems for all non-IE browsers. For IE, pixels/13.3333 = ems. (I find it useful to preserve up to four decimal places (1.2345) before rounding.)
Notes on Customizing Page Widths
Here are some other things to keep in mind.
- The width is set in
ems becauseems scale with user-initiated font-size adjustment. - YUI Fonts does a good job of normalizing the width of an
em, but we're still obliged to provide a slightly different value for IE. - Be sure the
widthvalue for IE comes after the value for everybody else. - Setting the
min-widthis optional, but helps the grid maintain integrity as the viewport shrinks. - The
text-alignandmarginare used to help center the page, and should not generally be modified.

