liveBook · Manning

Fixed-width layout

As explained in Math for Web Design

A layout pattern in which a page or container uses a fixed horizontal dimension rather than adapting its width to the available viewport.

A fixed-width layout assigns absolute horizontal dimensions to containers and elements. For example, a 960px body can contain a 640px article and a 320px aside. The result is predictable at the intended size, but screens narrower than 960px cannot display the page without horizontal scrolling. section 6.3.4 section 6.7

A fixed article-and-aside layout

body { width: 960px; } article { width: 640px; padding: 16px; } aside { width: 320px; padding: 12px; } The fixed widths establish a 2:1 article-to-aside relationship, but the body remains wider than smaller viewports. section 6.3.4

To make the same structure adaptable, replace fixed child widths with percentages and cap the outer container with max-width. Convert each width using: element percentage = (element fixed width ÷ parent fixed width) × 100. Thus, a 640px article inside a 960px parent becomes 66.67%, while a 320px aside becomes 33.33%. Apply the same conversion to related padding and margins when needed. section 6.3.4 section 6.7

Listing 6.2 A fixed-width layout
body {
    width: 960px;    #1
}
header {
    padding: 16px;
}
article {
    width: 640px;    #2
    padding: 16px;
}
aside {
    width: 320px;    #3
    padding: 12px;
}

Inspect the compact CSS listing for the fixed body, article, and aside dimensions. section 6.3.4

How Math for Web Design covers it

How deep it goes
Explains fixed dimensions, narrow-screen failure, and conversion to percentages, but does not develop fixed layouts beyond these calculations.
Examples
Uses a 960px body with 640px article and 320px aside, then converts them to 66.67% and 33.33% widths.
What you can do after
Apply fixed dimensions or convert them into percentage-based CSS for layouts that scale within a maximum width.
How it connects
Connects fixed-width layout to liquid layout, responsive design, Grid, Flexbox, media queries, and viewport units.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math for Web Design. The section links point to the parts of the book it draws on.