Forum Moderators: not2easy
Has the use of table "truely" be replaced by absolute positioning or are they preferred when positioning of written data is essential?
There are too many antiquated websites out there giving advise on programming techniques to sort things out.
Don
But, for all intents and purposes -- regular absolute positioning is safe to use. Most problems you would run into can either be avoided or worked around.
Floats are, IMO, quirkier in IE than AP is.
Absolute positioning requires knowing exactly where on a page you want your content. However, this does not take into consideration differences in font sizes, so someone viewing your page with a really large font size might have overlapping blocks.
Hence, why I try to avoid AP. :)
Absolute Positioning (AP) is most certainly viable technique, however it is in general misused by beginners in CSS due in part to tools like certain WYSIWYG editors which
a) call absolutely positioned divs, layers
b) use absolute positioning to build the entire site, therefore making it easy for a beginner to "stick a new bit" into page no matter what the source code order is (which is OK until you introduce nested postioned divs, even accidentally).
There is nothing wrong with AP but it should be used like every other positioning technique, where and if the job requires it, and really anyone should still learn a wee bit about how it works before trusting any tool.
There is a major upside to using AP and that is creating "full height" columnar designs, with header and footer (the supposed holy grail?) ~ and the take up on this has been held up because IE has never supported using ALL four co-ordinates together in order to size AP divs, therfore that has been a major drawback to the implementation of AP to its full potential.
So AP has it's IE quirks as well as floats, it's just that people seem more comfortable and able to deal with the floats complete with their IE drawbacks, plus there are at least workarounds for most IE float quirks, whereas the only solution for the IE AP bugs involve using javascript to detect screen heights/widths.
Now in saying all that IE7 appears to have tried to get their implementation of AP correct, you can now use all four co-ordinates (yippee) BUT they have caused some other errors (booo), e.g. padding overflow and if AP divs are nested IE can't calculate the bottom co-ordinate very well.. so it's time to watch and wait it's a huge step forward and if they get it right before final release we could be about to see AP take over in the race for the easiest way to create a multi column layout with bottom footer :) Which will drag it out of the dark hehe...
There are too many antiquated websites out there giving advise on programming techniques to sort things out.
Is absolute positioning out of the dark ages yet?
Suzy
[edited by: SuzyUK at 9:28 am (utc) on Feb. 4, 2006]
...since they require an explicit width.
not so much methinks these days Doc.. it's a "feature" now that floats without widths should exhibit the shrinkwrap behaviour, IE/Mac still has a problem if it's not there, but mostly it's fairly well supported (with the occasional IE workaround as usual)
btw your old favourite inline-block sorts IE/Mac ;)
Suzy
Technically that's a concern with floats as well, since they require an explicit width.
They do? Can you point me to a place in the specs that states this is the case? I can't find that rule anywhere.
EDIT:
The CSS 2.1 spec states:
10.3.5 Floating, non-replaced elements[...]
If 'width' is computed as 'auto', the used value is the "shrink-to-fit" width.
So width is not required on floated items.
If 'auto' is set as the value for one of the seven properties {'margin-left', 'border-left', 'padding-left', 'width', 'padding-right', 'border-right', and 'margin-right'} in an element that is inline or floating, it will be treated as if it were set to zero.
CSS 2
If 'left', 'right', 'width', 'margin-left', or 'margin-right' are specified as 'auto', their computed value is '0'.
The change to employ shrink-wrap of floated elements is a recent change to CSS 2.1 since it went back to being a WD, methinks.