SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Midwest
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scroll Bar within Inner Div Not Displaying

    Hello

    What I have is an outer container div, which will evenly be converted to a floating DHTM window. Inside the window, I have a header area where I never want scroll bars. Then I have a content div where if the content is larger then the content area, I do want scroll bars. In theory, I thought the below code should work but the content area does not show scroll bars when the content exceeds the content area height. Can someone see what I am doing incorrectly here? I have the content area overflow set to auto which should display scroll bars when they are needed. I have also tried moving the container overflow: hidden to the header style and that does not work either.

    Code:
    <html>
    <body>
    
    <div id="container" style="height: 400px; width: 400px; border: 1px solid; overflow: hidden;">
       <div id="header" style="height: 100px; border: 1px solid;">
          Header
       </div>
       <div id="content" style="overflow: auto;">
              Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
    	  Testing <br>
       </div>
    </div>
    
    </body>
    </html>
    Thanks in advance for your time.

  2. #2
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's the content div you want to scroll then you need to put a height on it.
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project

  3. #3
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Midwest
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the feedback. Here is what I changed.

    <div id="content" style="overflow: auto; height: 300px;">


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
  •