HTML and CSS Reference
In-Depth Information
absolute
Absolute positioning takes the element out of the normal document
flow—collapsing any space it may have otherwise used—and positions
it in relation to the origin point created by the last-positioned containing
block.
The code used for Figure 6.1 demonstrates how to use absolute position-
ing to place elements at the four corners of its containing element.
Figure 6.1
Elements placed
into four corners
with absolute
positioning.
div {
position: relative;
width: 150px;
border: 1px dotted #999;
}
div div {
position: absolute;
width: 25px;
height: 25px;
background-color: #ccc;
border: none;
text-align: center;
}
 
Search WWH ::




Custom Search