Positioned elements in quirks mode

The measurements of an element with absolute positioning are defined first by any specified measurement properties, such as height or width, and then by its content. This is true for block and inline elements. However, a relatively positioned element retains its block or inline measurements unless otherwise specified.

The following example shows that the measurements of a block element and an inline element are the same when the position property is set to absolute.

<div style="background-color: #CFCFCF; position: relative; top: 10px;">
   Text
</div>
<span style="background-color: #CFCFCF; position: absolute; top: 30px;">
   Text
</span>

You can use the same procedure to set or retrieve the measurements of positioned elements and non-positioned elements.

See also

Concepts

Cascading style sheet reference
Properties by name
Measurement and location properties in strict mode

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.