Position Absolute

position: absolute;
Removes a box (element) from the normal flow by ignoring the normal flow, and adds a 3rd Dimension to the web page with z-index.
As a result you can layer and overlap boxes (elements) on a web page with the z-index.
z-index: +ve value;
The Stacking level This property specifies the stack level of a box whose position value is one of absolute, fixed, or relative.
The stack level refers to the position of the box along the z axis, which runs perpendicular to the display.
position: absolute;
is calculated from the left and top of the browser. If you use position values from the right or bottom edge of the browser, the position values will change as the size of the browser window is contracted or expanded.
If a box (element) is a child, it measures it's position from the top and left corner of the parent box (element).



A Position: Absolute; Puzzle...

The Puzzle...

The set up.

layout1The web page is a simple layout. I want to place a "box" that overlaps the left column and the content area, as shown in this illustration. I also want the "box" 47 pixels from the side of the left column.

This is the HTML for the left Column.

<div id="leftcolumn">
<div id="bluebox">
</div>
</div>

As you can see the bluebox is "nested" inside the left column.

This is the CSS for the Left Column.

#leftcolumn {
             border: inset white 2px; 
             clear: left;
             float: left;
             width: 200px;
             height:500px;
             background-color: #9F6;
             }
        

This is the CSS for the Bluebox

    #bluebox {
	position:absolute;
	left:47px; 
	top:350px;
	width:350px;
	height:225px;
	background-color:#CFF;
	border: double red 4px;
	z-index:10;
    }

If you popup the actual web page with this link Pop-up the puzzle page and if you resize the browser (make it large as you can... ) you'll discover that the bluebox is positioned not to the left side of the left column, but to the left side of the BROWSER!)

What's the fix??? When you popup the bluebox puzzle, you can view the source, the menu is usually View > Source. You can then copy the source and paste it into your web editor, and fix the errant bluebox!

Have fun!

The Solution

Click here and

Pop up The Solution