PDA

View Full Version : CSS Absolute Positioning Auto+Pixels



Hypertext
06-09-2008, 10:59 PM
So I'm trying to absolute position something and using the left property as auto, I can get it to stay in the same spot in each size window, but then I want it to go about 7 pixels further to the left, but keep in the "auto range", so say it computes the auto as a left of 340 pixels, and then i need the left to be 350, if i just used 357px, then when somebody had a bigger browser it would be need to be computed as say 367px (360px auto), is there any way to do this "calculating"?

Jxhn
07-09-2008, 08:46 AM
I'm not really sure exactly what you want but if you want things to stay in the same positions for different screen resolutions you can do this:


whatever
{
position: absolute;
left: 50%;
margin-left: x;
width: x;
height: x;
}
Just change the value of margin-left until it's in the right position. It will be in the same position for all screen resolutions.

Want to hide these adverts? Register an account for free!