Results 1 to 3 of 3

Thread: Div with scrollbars

  1. #1
    Join Date
    Feb 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Div with scrollbars

    Hello!

    I'm trying to make a div with a scrollbar but I can't get it to work properly.

    Here's the page

    Press the Stockholm area (The one with the most dots in it, if you arent Swedish ) and notice how the div grows by itselfs. As you can see in my code I have giving the div and the cell thier height in px, I've also set the div to have scrollbar function but this aint working...

    Code:
     <td width="370" height="400px" align="left" valign="top"><div id="contentarea" height="370px" width="400px" style="overflow:auto;"></div>
    
    			  
    </td>
    If anyone know why? please reply. Thanks!

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    All you have to do is set the height to your desired height and set in the css:
    Code:
    overflow:auto
    - Mike

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Division elements cannot have their dimensions set via attribute as you have done. They must be set as a part of the style:

    Code:
    <div id="contentarea" style="width:400px;height:370px;overflow:auto;"></div>
    There could also be other problems.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •