You are previewing CSS3 Foundations.

CSS3 Foundations

Cover of CSS3 Foundations by Ian Lunn Published by John Wiley & Sons
O'Reilly logo

chapter nine

Understanding Display, Position, and Document Flow

In this chapter, you complete the main layout of Cool Shoes & Socks, making use of the display and position properties. Plus, you learn about the flow of a document. Later in the chapter, you use some of the more advanced CSS selectors that were covered in Chapter 3, to create a drop-down menu that will appear when users hover over the “Shop” link.


Project files update (ch09-00): If you haven’t followed the previous instructions and are comfortable working from here onward or would like to reference the project files up to this point, you can download them from

Document Flow

A document is the fancy name for a web page. A web page has a flow, which determines the layout of elements. Prior to the preceding chapter, in which you made elements float, the entirety of the Cool Shoes & Socks page had a “normal flow.”

All elements on a web page, by default, have a normal flow, referred to as being “in flow.” This means the position of one element affects the next. Figure 9-1 shows how the Cool Shoes & Socks page looked at the end of Chapter 7, where all elements were in flow—each element following the next.


Figure 9-1 The Cool Shoes & Socks page as it was at the end of Chapter ...

The best content for your career. Discover unlimited learning on demand for around $1/day.