#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2004
    Posts
    566
    Rep Power
    11

    Div with vertical scroll bar


    How do I create div that shows vertical scroll bar if div id="content_area" is too big?
    Code:
    <div style="padding:10px; height: 100px">
    	<div id="content_area">		
    	some text here
    	</div>
    	<div class="clear"></div>
    </div>
  2. #2
  3. Classical Computing
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    893
    Rep Power
    102
    Rather than have two divs, have one div, give it a fixed height, and add to the CSS overflow: scroll;.

    That will add a vertical scroll bar to the div.
    Simple is beautiful.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2004
    Posts
    566
    Rep Power
    11
    Thanks, but I would like to have just vertical scroller.
    I have tried
    overflow:auto;
    and it works well with FireFox but IE adds horizontal scroller.
  6. #4
  7. Classical Computing
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    893
    Rep Power
    102
    OK, try overflow-y: scroll, or set a fixed width on the div.
    Simple is beautiful.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2004
    Posts
    566
    Rep Power
    11
    Thank you.

IMN logo majestic logo threadwatch logo seochat tools logo