dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: overflow auto

  1. #1
    Join Date
    Nov 2007
    Posts
    140

    overflow auto

    normally when i have a container div which for example has 2 inner divs floating left i usually float the container set it with a width and set height as auto so that as the height of any of the 2 inner divs increases the container div automatically increases

    for the 2 inner divs i write
    #outerdiv .innerdiv1{
    float: left;
    width: 400px;
    height: auto;
    }
    #outerdiv .innerdiv2{
    float: left;
    width: 500px;
    height: auto;
    }

    however i have seen a code for such a situation wherein the container is mentioned as
    #containerdiv{
    overflow: auto;
    }


    here the containerdiv is not set to float left and no width and height specified and only a single line as overflow: auto

    my question instead of setting a float left, width of some value and height to auto for the containerdiv what is the need to use #containerdiv{ overflow: auto;} what advantage would it give if i were to have instead as #container{float: left; width: 900px; height: auto;} which i usually do

    please advice

    thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    The real difference is in how a long string of text is handled. If you have an unbroken string of text which exceeds the 900px normal behavior allows the string to leave the division boundries and continue over the adjoining division. Overflow:auto suppresses the text over 900px and creates a scroll bar to allow you to view the remainder.
    54 68 65 42 65 61 72 4D 61 79

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles