liveBook · Manning

Banded content

As explained in Web Design Playground, Second Edition

A content band is a horizontal page-layout region with a full-width background and foreground content constrained within a centered inner area.

Banded content divides a page into horizontal strips. Each strip can carry a background across the browser window while keeping its text and images in a narrower, centered area. That matters when a full-width paragraph makes readers work harder than they should. section 10.5

Build each band with two nested div elements:

  • Style the outer div with the band’s full-width background color or image. section 10.5
  • Put the content in an inner div, give it a maximum width, and center it horizontally. section 10.5

A landing page, one strip at a time

A product page can use separate bands for its header, description, testimonials, and purchase options. The description stays readable instead of stretching from one edge of the window to the other; the bands’ backgrounds still fill the available width. section 10.1 section 10.5

<div class="header">
    <div class="container">    #1
    ...                        #1
    </div>                     #1
</div>
...
<div class="description">
    <div class="container">    #1
    ...                        #1
    </div>                     #1
</div>

Notice the repeated pattern: each outer band contains a div with the container class. section 10.5

.container {              #1
    max-width: 800px;     #1
    margin: 0 auto;       #1
    clear: both;          #1
}

.container::after {       #2
    content: "";          #2
    display: block;       #2
    clear: both;          #2
}

The container’s maximum width limits line length, while its automatic side margins center it. The remaining rules handle floated content inside the container. section 10.5

How Web Design Playground, Second Edition covers it

How deep it goes
Works through nested div structure and container CSS, including maximum width, centering, and clearing floats.
Examples
Uses a fictitious book’s landing page, with header, description, testimonials, and product-version bands.
What it assumes
Assumes basic HTML and CSS skills, then teaches the two-div band structure.
What you can do after
Build it from scratch with full-width outer divs and centered, width-limited inner containers.
How it connects
Connects landing pages, CSS backgrounds, maximum width, horizontal centering, and floats.

Related concepts

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