Frontend Engineering, Volume II

CSS: Chapter 3 Companion—Positioning

© 2013, Martin Rinehart

One of our topics: wrapping text and divs around an image.

Full-width div with content wrapping around float.


The history of CSS, by founders Lie and Bos:

Quick summary, CSS 2 history:

CSS 2, as seen in 2003:

Normal Flow

The W3C specification for CSS 2.1:

Additional W3C specification for CSS 2.1:

A "Quick Tip" that's reasonably thorough:

Inline elements in normal flow:

Block elements in normal flow (includes HTML5)


This shouldn't be necessary, but it is:

Photos for Free

The best way to get photographs for your site is to take them yourself. Then you are sure you have the rights you need. (People in your shots? Look into model releases. Generally, in the U.S., people who are not performers, politicians or otherwise in the public eye cannot be used unless they agree, in writing.)

The second best choice is to use a free photo. Search online for "free photos" and you will find lots. Most of them are not, however, free. Here's one place to start looking.

Free photos? Really!

Whether the source is free or paid, proper attribution ("photo of ... courtesy of ...") is good netiquette.

Position Property

Self-described Positioning 101 (from a deservedly popular blog):

CSS compatibility, circa 2010:

Authoritative, if dated, with good information on why your positioning may be ignored:

Z Index

The CSS 2.1 specification is here:

The CSS 2.1 specification is in 18 chapters and 8 appendices. Chapter 9, the "Visual formatting model" is here:

For the Z index, you want subsection 9.9, "Layered presentation":

We encourage you to read 9.9 down to the the disclaimer that tells you the full Z index specification is found in Appendix E, "Elaborate description of Stacking Contexts." For the very determined, that is here:

If this is not enough to make you decide to always use markup order, not the Z index, Appendix E ends this way:

While the backgrounds of bidirectional inlines are painted in tree order, they are positioned in visual order. Since the positioning of inline backgrounds is unspecified in CSS 2.1, the exact result of these two requirements is UA-defined. CSS3 may define this in more detail.

"UA" is specification-speak for "user agent," meaning the browser. CSS3 has yet to define this detail.


Chris Coyier's CSS-Tricks blog is widely followed, and for good reason. This post re floats is exceptionally well illustrated:

Also from Coyier, this post explains a kludge (a clumsy way of achieving a desired effect) re clearing floats. Sometimes a kludge is needed.:

One more from Coyier on collapsing divs and floats:

Display Properties

Exceptionally thorough, including upcoming CSS3 properties and, at the bottom, a helpful browser implementation table:

Classic and up-to-date, PPK includes a "Playground" where you can try display settings:

block and inline-block:

Feedback: MartinRinehart at gmail dot com

# # #