HighDots Forums  

What's so terrible about absolute positioning?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss What's so terrible about absolute positioning? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alan Silver
 
Posts: n/a

Default What's so terrible about absolute positioning? - 03-16-2006 , 10:30 AM






Hello,

Having been a light reader of this ng for a few months now (after
several years absence), I have noticed that absolute positioning seems
to be considered a Very Bad Thing around here. Generally, when someone
posts a question about a design that uses it, they are told not to.

Now, in my ignorance, I don't see what's wrong with it, when used
sensibly. Let me say straight off that I am *not* talking about trying
to produce pixel-perfect designs, that's not what the web is for
(AFAIK).

As an example of what I mean, suppose you wanted a three-column layout,
with the left and right columns fixed width (in em or %), and the middle
column fluid. It looks like you could do this really easily with
absolute positioning. You could fix the position of the left and right
columns, and give the middle one margins to suit. Seems very robust and
simple to me.

Now, given that I'm *no* expert in this, would anyone care to comment on
this? There must be some reason why people don't like absolute
positioning, unless the negative reaction is against people trying to do
pixel-perfect design. Comments?

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

Reply With Quote
  #2  
Old   
Spartanicus
 
Posts: n/a

Default Re: What's so terrible about absolute positioning? - 03-16-2006 , 11:14 AM






Alan Silver <alan-silver (AT) nospam (DOT) thanx.invalid> wrote:

Quote:
Having been a light reader of this ng for a few months now (after
several years absence), I have noticed that absolute positioning seems
to be considered a Very Bad Thing around here. Generally, when someone
posts a question about a design that uses it, they are told not to.

Now, in my ignorance, I don't see what's wrong with it, when used
sensibly.
Correct, but if you look at the examples that are criticized here it is
not used sensibly.

Quote:
Let me say straight off that I am *not* talking about trying
to produce pixel-perfect designs, that's not what the web is for
(AFAIK).
Many don't realize that, to them absolute positioning is a way to
finally get rid of that awkward "doesn't always look the same" thing.
This often results in people absolutely positioning every blooming
element.

Quote:
As an example of what I mean, suppose you wanted a three-column layout,
with the left and right columns fixed width (in em or %), and the middle
column fluid. It looks like you could do this really easily with
absolute positioning. You could fix the position of the left and right
columns, and give the middle one margins to suit. Seems very robust and
simple to me.
Yes that's fine in principle, although 3 columns is a lot (typically
won't scale well to narrower viewports).

--
Spartanicus


Reply With Quote
  #3  
Old   
Alan Silver
 
Posts: n/a

Default Re: What's so terrible about absolute positioning? - 03-16-2006 , 11:54 AM



In article
<vv6j129b81q1b8jahnnhu4cjv0mof8mrgg (AT) news (DOT) spartanicus.utvinternet.ie>,
Spartanicus <invalid (AT) invalid (DOT) invalid> writes
<snip>
Quote:
As an example of what I mean, suppose you wanted a three-column layout,
with the left and right columns fixed width (in em or %), and the middle
column fluid. It looks like you could do this really easily with
absolute positioning. You could fix the position of the left and right
columns, and give the middle one margins to suit. Seems very robust and
simple to me.

Yes that's fine in principle, although 3 columns is a lot (typically
won't scale well to narrower viewports).
OK, that's a separate point. I was using this merely as an example of
where absolute positioning appeared to offer a significant benefit.

Thanks for the reply, you've set my mind at ease!!

--
Alan Silver
(anything added below this line is nothing to do with me)


Reply With Quote
  #4  
Old   
Andy Dingley
 
Posts: n/a

Default Re: What's so terrible about absolute positioning? - 03-17-2006 , 02:56 AM



On Thu, 16 Mar 2006 16:30:21 +0000, Alan Silver
<alan-silver (AT) nospam (DOT) thanx.invalid> wrote:

Quote:
I have noticed that absolute positioning seems
to be considered a Very Bad Thing around here.
Second problem - absolute positioning only makes sense on an absolute
canvas. If you're aiming for a fluid design on varying windows, then
absolute positioning makes this hard. It's like table-based layout - an
easy way to control grid-based layouts, but we don't _want_ grid-based
layouts.

Main problem though is that absolute jumps out of the page flow and
stops a lot of UI stuff working easily (browser dependent). It's OK for
a floating toolbar or such, but not good for the main body text column.


Also doing it right isn't exactly difficult ! It's not easy to work it
out, but it's very easy to find a well-implemented example from a good
tutorial site and use that.


Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.