|
Here's an example of why using overflow: auto; might work better. If you do this: #container{float: left; width: 900px; height: auto;}
but you wanted the container div to be centered, it would be a little difficult to achieve because you are floating the container to one side. If you use overflow: auto; instead of floating the container, you can apply auto margins on the container to center it - like this: #container{overflow: auto; width:900px; margin: 0 auto;}
Another advantage would be that when you use overflow: auto; instead of floating the container, you aren't removing the container from the natural flow of the document. Floating the container could cause you to get some weird results with surrounding content. If you can avoid floating the container, you know other elements outside of the container should behave normally.
|