Chapter 21. Positioning

by Chris Mills

Having conquered the menaces of floats and clearing in the last chapter, we will now turn our attention to the second advanced layout-related topic you should be familiarising yourself with: positioning. This feature of CSS allows you to take elements out of the normal document flow (i.e., where they are placed by default before any CSS is applied to them) and shift them left, right, up and down, putting them somewhere else entirely. This is useful for a variety of layout purposes, such as multiple column layouts, putting captions on photographs, keeping a feature such as a menu or heading in the same position on the screen regardless of how much the browser is scrolled, and more.

In this chapter, we will ...

Get InterACT with Web Standards: A holistic approach to web design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.