...

View Full Version : Absolute positioning... Good or bad and why?



Doctor_Varney
10-29-2008, 11:51 AM
Can anyone offer any reasons why a site using absolute positioning throughout, for a complex layout, would be a bad idea?

effpeetee
10-29-2008, 12:33 PM
Can anyone offer any reasons why a site using absolute positioning throughout, for a complex layout, would be a bad idea?
It breaks up very much if the viewers resolution is different from the original.
If you give a div a left margin of 1000px and the viewer is using 800x600; the result will be a bit of a disaster. Having said that, absolute positioning has its place if you are careful how you use it.

In a closed system where there is complete control of the viewing monitors, it is obviously OK.

Have you seen this page? (http://css-discuss.incutio.com/?page=AbsoluteLayouts)

Frank

VIPStephan
10-29-2008, 04:23 PM
Yeah, can only second what effpeetee said. Absolute positioning can be useful if you use it wisely and where it wouldn’t break anything, for example for inline popup “windows” or if ou have elements within a container that don’t interfere with each other if the user resizes his/her text or browser window. It depends what you understand by a “complex layout”, though. Sometimes layouts are that complex that you just can’t do without absolute positioing. In such cases the combination with overflow: auto; and using em units for sizes can keep issues at a minimum.

Mostly the bad thing about absolute positioning is that you have no control over the layout if the content of elements or the general available space is changing for some reason. So it’s wise to use it only for things where this isn’t crucial.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum