Tuesday, March 2, 2010

Centering position: absolute div

Here is the trick :)

.myclass {
position: absolute;
left: 25%;
top: 0;
}

if you need the center based on the parent starting position, makesure the parent have:
position: relative;


No comments: