View Full Version : calling all veteran html/css coders: absoloute positioning opinions?

code beginner
05-14-2010, 02:49 AM

i was hoping Gnome On the Run or some of the other experienced coders around here could chime in on this one:

i used absolute positioning to place a few elements in the upper-left hand corner of the screen, some of which have javascript behaviors in them. i used ems as the locating specifications.

it's working really well, i tested it in firefox, ie, opera, and safari.

but i've heard vague warnings to "avoid absolute positioning", due to unpredictable user experiences.

what's the experienced coders' take on absolute positioning? it seems like "a few things in the upper-left hand corner" should be ok (for example, to lock a site logo in stone into the upper left hand corner). it's working so well that i'm almost concerned.

05-14-2010, 02:57 AM
Hello code beginner,
There are certainly times that ap is needed and there's no problem with using it when it makes sense to do it that way. A lot of times the problems from using it are just because the author doesn't understand what the ap is relative to and that is usually an easy fix.
There is nothing really wrong with ap, it's not like using tables for layout, slicing up images or using spacer divs.

A good rule of thumb is, if it works without it... don't use it.
It's always better to let the document flow naturally. If that doesn't work, ap to your hearts content!

code beginner
05-14-2010, 03:17 AM

that's good to know. it's kind of in a tricky spot on the page and the other "go-to" methods weren't producing the right results. then i tried absolute positioning and it worked immediately. it also gave me really good control by using the ems.