HTML and CSS Reference
In-Depth Information
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
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
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