O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

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

Positioning Elements

In CSS2, the position property enables you to position elements on the page. It takes the following values: static, absolute, relative, and fixed. The static value corresponds to the normal flow and is the default. The absolute value positions an element relative to the containing block. The relative value positions an element relative to its current position. The fixed value “fixes” an element's position relative to the browser window, so that it remains fixed when the page is scrolled. The fixed value is currently only supported by Opera 5 (with some bugs).

Using Absolute Positioning

The position: absolute property specifies that an element is to be positioned relative to the containing block. If the element is nested inside ...

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