zygoma — 2012-12-05T04:22:30-05:00 — #1
Buon giorno from 1 degrees C very icy wetherby UK..
In my quest to get a firmer understanding into CSS and layout principles Ive noticed alot of overflow hidden & auto gets used. Please could a sitepoint memeber give me a little theory behind whu you need to use them with floated divs.
paulob — 2012-12-05T04:47:45-05:00 — #2
There are a few reasons why you would need overflow other than visible and they are listed below:
a) To hide any overflow that you don't want visible. That means that any content that sticks out of the element will not be seen or interfere with anything else. However you will never be able to access the content that is hidden.
b)To create a new block formatting context in order to contain floated children (originally discovered by me some years ago and now a popular way to contain floats when visible overflow isn't required. It has some drawbacks especially if you use negative margins but is just another tool in the box).
a) To allow access to overflowing content within the element by means of scrollbars
b) Same as "b" as above but with the risk that you will get scrollbars where content sticks out so best to use overflow:hidden if used for containing floats.
Hope that explains it:)
zygoma — 2012-12-06T04:20:37-05:00 — #3
Thanks Paul, Perfect