467,888 Members | 1,528 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,888 developers. It's quick & easy.

What's so terrible about absolute positioning?

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)
Mar 16 '06 #1
  • viewed: 1893
Share:
4 Replies
Alan Silver <al*********@nospam.thanx.invalid> wrote:
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.
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.
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
Mar 16 '06 #2
In article
<vv********************************@news.spartanic us.utvinternet.ie>,
Spartanicus <in*****@invalid.invalid> writes
<snip>
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)
Mar 16 '06 #3
Alan Silver wrote :
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?

1- MSIE 6 has **lots** of implementation bugs on absolute positioning,
on containing block calculations.
2- Abs. pos. content is extraordinary difficult to select with mouse and
keyboard in MSIE 6
3- Abs. pos. blocks are taken out of normal flow; accessibility and
usability of a website often underestimate this. Non-abs. pos. blocks
will therefore behave quite differently from abs. pos. blocks.

Gérard
--
remove blah to email me
Mar 16 '06 #4
On Thu, 16 Mar 2006 16:30:21 +0000, Alan Silver
<al*********@nospam.thanx.invalid> wrote:
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.
Mar 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Harlan Messinger | last post: by
4 posts views Thread by mike eli | last post: by
1 post views Thread by Lars A. Gundersen | last post: by
2 posts views Thread by Rob R. Ainscough | last post: by
6 posts views Thread by Mark | last post: by
20 posts views Thread by mehstg1319 | last post: by
14 posts views Thread by Fistro | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.