An Old Way

It has been possible for a long time to create a grid of boxes that fills the browser width and wraps nicely (when the browser is resized), by using the float property:

HTML file: Displayed by browser:
<style>
.floating-box {
    float: left;
    width: 150px;
    height: 75px;
    margin: 10px;
    border: 3px solid #8AC007;
}
.after-box {
    clear: left;
    border: 3px solid red;
}
</style>
<body>
<h2>The Old Way - using float</h2>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="floating-box">Floating box</div>
<div class="after-box">Another box, after the floating boxes...</div>
</body>

The Old Way - using float

Floating box
Floating box
Floating box
Floating box
Floating box
Floating box
Floating box
Floating box
Another box, after the floating boxes...

However, the inline-block value of the display property makes this even easier, as you will see on the next webpage...

Back button Table of Contents Next button