views:

396

answers:

2

I've seen this problem on the web, and all the suggested solutions aren't working for me, so I thought I'd come here. I have a page that has an iframe. The top of the page is a dropdown menu, the rest of the page is the iframe. The idea like I'm sure everybody else does, is to have the menu stay stationary and the menu selection runs an application in the iframe. The contents of the iframe should scroll, but the page as a whole should not. I've tried putting the iframe width=height=100% inside a single table element also with width=height=100% but I get two scrollbars if I make the window too short vertically.

Any suggestions?

I think I didn't explain myself well. I want to keep the scroll bar in the iframe as auto, but I don't ever want a scroll bar for the whole page. I need the iframe to size appropriately so it always takes up exactly the remainder of the page so the browser doesn't have to make a scroll bar because the iframe should never extend off the bottom of the viewing area.

+2  A: 

set css overflow to hidden on whatever frame you want to rid scroll bars from...

overflow:hidden
gmcalab
I don't just want the scrollbar to go away, I want the need for the scroll bar to go away, I edited my question to try and make the problem more clear.
stu
+1  A: 

UPDATED:

DEMO: http://jsbin.com/ewomi3/3/edit

HTML

<table border=0 cellspacing=0 cellpadding=0 id="hold_my_iframe">
    <iframe src="http://www.w3schools.com/css/tryit.asp?filename=trycss_overflow" width=100% height=100% marginwidth=0 marginheight=0 frameborder=0></iframe>
   </table>

CSS

   * { margin:0 padding:0 }
   body { margin:0; padding:0; text-align:center }  
   #hold_my_iframe { padding:0px; margin:0 auto; width:100%; height:100% }

NOTE: i have finally understood what you want! ;-) use table instead of div as container! see the demo and enjoy it!

aSeptik
I edited my question, I want the iframe to scroll, but not the main browser page.
stu
I'll have to go learn me some more css. thanks.
stu