Quote: "Phaelax: I'm pretty sure absolute is from 0,0 at the top left of the view port (page). Relative position is 0,0 of its container."
Actually Phaelax is right. Positioning is always relative to its container (If the container has position: relative specified).
Run this:
<html>
<head>
<style type="text/css">
body {
padding: 50px;
}
div{
display: block;
width: 200px;
height: 200px;
background: #999;
margin: 1px;
}
div#relative {
position: relative;
}
div.text {
width: auto;
height: auto;
background: #FCF;
position: absolute;
top: 10px;
left: 50px;
}
</style>
</head>
<body>
<div>
<div class = "text" >Block 1</div>
</div>
<div id = "relative">
<div class = "text" >Block 2</div>
</div>
</body>
</html>
Fixed positioning is always to the browser 0,0