Fixed, Fluid, Elastic Layout
Fixed, Fluid, Elastic or a hybrid layout design – Each option has its own benefits and disadvantages. But the final decision depends so much on usability that it is not one to be made lightly.
In CSS the width of a box is set using the width property with any unit of length, for example:
DIV#col1 {
width:400px }
DIV#col2 {
width:50% }
DIV#col3 {
width:33em }
Fixed Layout
A fixed width site is one where the main wrapper is set to a specific immovable width independent of the user agent’s display resolution. A common and considerate fixed width is 760 pixels, a size that ensures users with 800×600 resolution monitors have close to full window viewing without annoying side-scrolling.
This fixed-width div is 400 pixels wide. This example cannot be resized due to its fixed width. If the text is enlarged, it’ll wrap.
Fluid Layout
A fluid or liquid layout is created by not specifying a wrapper width at all or doing so using the percentage unit of measure. In other words, barring borders and padding screwing things up, a 100% width site will take up the entire view port width without producing a horizontal scroll bar.
This fluid-width div is 74% of the container’s fixed width. This example cannot be resized due to its fixed width parent. Changing screen size will have no bearing and if the text is enlarged, it’ll wrap.
Elastic Layout
An elastic site’s main wrapper and other elements are measured using ems as the unit of measure. Ems are relative proportionally to the text or font size. Thus, as the text size is increased, the sections measured in ems will increase in size as well.
This elastic-width div is 35ems wide. This example will change width as the text is enlarged, but this example has no width limiter.
Tags: % examples, Elastic Layout, em, Fixed, Fluid, px