View Single Post
Old 13-05-2003, 03:37   #8 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,200
Re: floats v's positioning

[quote:6cf378f206="Bill Posters"] [quote:6cf378f206="smallbeer"]The the down side is that you're stuck with the document flow structurally[/quote:6cf378f206]

and that's bad because...?

[quote:6cf378f206="smallbeer"]...whereas absolutely positioned elements can be placed anywhere in your markup.[/quote:6cf378f206]

and that's better because...?
[/quote:6cf378f206]

If you absolutely position a navigation bar for example, you can structure code so that it appears at the bottom of your html but to the left in the browser. I never use absolutely positioned divs but they do have benefits.


[quote:6cf378f206="Bill Posters"]
[quote:6cf378f206="smallbeer"]
The problem I find is, and it really shouldn't be a problem, is say a simple 2 column layout. Left column positioned relatively with a right margin large enough to position absolutely a right column. The problem is, if you want anything to be positioned underneath these divs, a footer in most cases, the left column always has to be longer than the right.

The only way I've gotten around this is to use floats.
[/quote:6cf378f206]

I'm being a bit dense this morning and having trouble picturing what you are describing. Can you knock up an example or post a screenshot as what I'm imagining is not a complex task at all.
[/quote:6cf378f206]

Like I said, it was just a ramble. If you know of a way to make an absolutely positioned div 'clear' elements that follow it though I'd be happy to hear it.

[quote:6cf378f206="Bill Posters"]
Also, why do you consider using floats to be a problematic method?
[/quote:6cf378f206]

I'm not sure they were meant to be used for layout thats all. The hacks (spacer divs) you have to use to implement them makes them no better than tables and mean we only encourage the kind of browser code bloat and support problems that standards was devised to sift out.

[quote:6cf378f206="Bill Posters"]
I'm not sure whether I'm simply not recognising the problem as you describe it or if you're hoping for a solution to a problem which isn't really a problem at all.[/quote:6cf378f206]

It's definitely one of those.
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote