[thelist] nested div/floats and browser issues in CSS

Simon Willison simon at incutio.com
Wed Jul 17 19:05:01 CDT 2002


At 15:03 17/07/2002 -0700, Tom Dell'Aringa wrote:
>1) Does nesting divs or elements within divs have any repurcussions
>generally? Such as:
>
><div id="outerBox">
>    <div id="innerBox">Content</div>
></div>

Nope, nested divs are unlikely to cause any problems at all (although I
would imagine nesting a large number of them could cause browsers like NS4
to eventually keel over)

>2) What about floating that same nested div, either left or right?

Floating can sometimes lead to strange behaviour in my experience - I'm
still getting to grips with it though. Good advice is not to float "large"
divs - small blocks and images work fine, but when you start floating a
large chunk of your layout you may run in to performance problems and
possibly strange browser bugs.

Dorothea Salo wrote an excellent piece on CSS positioning today which could
give you a big boost in getting to grips with CSS:

http://www.textartisan.com/caveatlector/archive/2002_07.html#e000295

Hope that helps,

Simon Willison
http://www.bath.ac.uk/~cs1spw/blog/





More information about the thelist mailing list