Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Positioned elements

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;">
<span style="background-color: #CFCFCF; position: absolute; top: 30px;">

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

Community Additions

© 2015 Microsoft