On Sun, 08 Dec 2002 17:40:38 -0800, Michael Ryznar [EMAIL-REMOVED]>
> What is the best way to position two divs beside each other
The problem with float (other than browser bugs) is that it has to be first
in the code. 'Position' might be better.... Remember that for non-CSS the
code ends up in the way that you have it in the file itself.
However, if you can overcome that minor blip, it can be used well.
> float: left. This seems to work. The divs line up horizontally. (I clear
> the effect by adding a clear: left to the next element). Is this the
> proper way to achieve this effect?
> The reason I ask, is I was looking at another book which mentions the
> "display: block" and the "display: inline" declarations
Not sure what you are talking about here... DIVs are display:block.
You need to set an explicit width with floated DIVs (and make sure they
don't add up to 100% to avoid some browser bugs.
> I considered positioning the divs absolutely but that wouldn't work
> because I would like the two divs to flow with the rest of the document
> in the document flow.
Life is a series of balances and trade-offs... the trick is being well
versed and well experienced enough to choose which is best
> The second part of my question is, if floats are the way to achieve
> Divs, couldn't one theoretically layout a 3 column web site using 3
> containing divs set to float? Or are there pitfalls to this method?
One could theoretically created a 100 column web site using 100 floats.
> Is it not a good idea to use floating divs for the main structure of a
Depends on who you ask.
Timothy J. Luoma
Sponsored by www.westciv.com - CSS resources | software | learning