CSS: Absolute Position
position:absolute
make a element into its own layer. The normal flow of elements will flow as if that element doesn't exist.
It will be positioned relative to its “containing block”.
A “containing block” is effectively the first parent element that has a position value other than “static”. When no parent has any of “position” spec, then it is relative to the <html>
element.
To specify the offset, use:
top:length
bottom:length
left:length
right:length
Here's a example of position absolute with offset:
AAA
BBB
CCC
Here is the HTML:
<div id="box09644"> <div>AAA</div> <div id="offset80239">BBB</div> <div>CCC</div> </div>
Here is the CSS:
#box09644 { position:relative; border:solid thin blue; width:300px; } #offset80239 { position:absolute; top:8px; left:30px; border:solid thin pink; color:red; }
With no CSS, it displays in your browser like this:
AAA
BBB
CCC
CSS, Layout
- CSS: Display Property
- Pure CSS Table
- CSS: 3-Column Side-Panel Layout
- CSS: Newspaper Text-Flow Over Multi-Column Layout
- CSS: Text Flow Around Image
- CSS: Hide Element (visibility)
CSS, Layers
- CSS: Position Property
- CSS: Fix Element to Window
- CSS: Position: Relative
- CSS: Absolute Position
- CSS: Text Over Image
- CSS: z-index