Layout Question

Hi,

What is best practice to do for CSS page layout?

Should I use percentage or pixel for layout?

Thanks!

That’s too vague a question to get a useful answer.

The ideal design is one that flexes to fit in whatever size browser window is available. (Within reason … obviously if people have really narrow windows then it probably won’t be feasible to squeeze three columns in, or if people have really wide windows then you probably want to put a limit on how wide the site will stretch.)

The first conclusion you can draw from that is that setting the width of everything in pixels won’t allow you to do that, because you will have given the whole site a fixed width. So you might decide to set the width of the sidebars to a specific px width, or a specific em width (ie, will grow as text size grows), and leave the main content area to fit the remaining space. Or you might decide to set the width of each section as a % of the total width, so that the proportions stay the same as the window is resized.

Ultimately, it depends on your design.