O'Reilly logo

Cascading Style Sheets: Designing for the Web, Third Edition by Bert Bos, Håkon Wium Lie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Relative and Absolute Positioning

The normal way a document is laid out is that the boxes for all elements are put one after the other or below the other (depending on whether they are inline or block), with their distances and alignments specified by properties such as margin, padding, and width. An occasional box is shifted to one side with the float property. In this way, the boxes fill the canvas, or the pages, starting from the top and continuing until all boxes are placed.

Relative positioning adds to this the ability to make corrections to the positions of individual boxes without affecting other boxes. For example, a box may be moved up or down to overlap another box. It is seldom needed in a style sheet. The place where the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required