O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

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

Name

position

Values:

static | relative | absolute | fixed

Initial value:

static

Applies to:

All elements

Inherited:

No

Computed value:

Same as declared value

Description:

Defines the positioning scheme used to lay out an element. Any element may be positioned, although an element positioned with absolute or fixed will generate a block-level box regardless of what kind of element it is. An element that is relatively positioned is offset from its default placement in the normal flow.

Examples:

#footer {position: fixed; bottom: 0;}
*.offset {position: relative; top: 0.5em;}

Note:

Fixed positioning is supported by Internet Explorer only in versions 7 and later.

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