SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Overflow Hidden Overflow Auto Explanation

    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.

    Grazie tanto,
    David
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,347
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    There are a few reasons why you would need overflow other than visible and they are listed below:

    1) Overflow:hidden

    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).

    2)Overflow:auto

    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

  3. #3
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, Perfect :-)
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •