Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-29-2008, 11:51 AM   PM User | #1
Doctor_Varney
Regular Coder

 
Doctor_Varney's Avatar
 
Join Date: Mar 2008
Location: Midlands, UK
Posts: 649
Thanks: 45
Thanked 29 Times in 28 Posts
Doctor_Varney will become famous soon enough
Absolute positioning... Good or bad and why?

Can anyone offer any reasons why a site using absolute positioning throughout, for a complex layout, would be a bad idea?
__________________
Definition: Computer rage is a heightened physiological response with associated feelings of anger and frustration[1] resulting from using a computer or other complex electronic device. It may result in the physical assault of the computer or similar item.[2] Computer use often leads to verbal abuse and occasionally physical violence towards the object.[3] Computer rage may be caused by distress due to a hardware or software problem which the enraged person is unable to correct.
Doctor_Varney is offline   Reply With Quote
Old 10-29-2008, 12:33 PM   PM User | #2
effpeetee
Senior Coder

 
effpeetee's Avatar
 
Join Date: Feb 2007
Location: Clapham Junction - London SW
Posts: 4,884
Thanks: 228
Thanked 204 Times in 203 Posts
effpeetee is an unknown quantity at this point
Quote:
Originally Posted by Doctor_Varney View Post
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?

Frank
__________________
* Sources (updated: 21.11.2012.
Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

Last edited by effpeetee; 10-29-2008 at 01:19 PM..
effpeetee is offline   Reply With Quote
Old 10-29-2008, 04:23 PM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:36 AM.


Advertisement
Log in to turn off these ads.