Eric Jarvis <we*@ericjarvis .co.uk> wrote:
in general it seems best to start by using relative positioning, and only
go to absolute positioning if the design requires it...a lot of people
seem to work the other way around and I'm not entirely sure why...what am
I missing?
Capitalization? ;-)
The poor design of the CSS2 Recommendation itself. It says, there are
three formatting models: flowed, floated, and absolutely positioned.
Reader thinks, "I have three options, which to choose? Better read
on..."
Then under the guise of explaining "normal flow", it starts to waffle
about "line boxes", a "block formatting context" and an "inline
formatting context". Reader's brain starts to numb and he thinks "Too
weird, what's my next option?"
The next section describes floats, but only deals properly with inline
floats - moving an image to the side and letting a paragraph flow
around it. That is the CSS1 equivalent for replacing the HTML align
attribute. Reader thinks that is irrelevant to laying out blocks of
text, "What's my last option?"
Absolute positioning.
All that business of inline formatting will always be there,
regardless of whether the blocks are laid out using flow, floats or
positioning. So the explanations of line boxes and inline formatting
should really be in the chapter that deals with text formatting, not
in the "visual layout model" chapter at all.
But the text chapter comes after the layout chapter, and you really
need to know about the box model before you can position boxes. The
authors of CSS2 assumed their readership would be familiar with CSS1
so they put all the shiny new stuff (positioning) at the front. That
was a mistake (that CSS 2.1 should have fixed).
If the box model was explained in the text chapter, and that was read
before the layout chapter, people's eyes wouldn't glaze over while
they were trying to read about "normal flow".
--
Karl Smith.
Interim President,
International Global World "Jonathan Frakes
must never work in films again!" Society