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.
Well, the question is old, but I had today the same problem, and none of the answers solved my problem. With internal pages (same domain) only, two vertical scrollbars appeared too. One to navigate the loaded page (correct), and another one to adjust a little bit the height of the iframe zone (!)... With external source pages it seems to work well.
The way I fixed this problem was to add a class to the body of the internal page to load, like this
and put the following in my CSS file
I hope it helps someone in future.
Seeing as this question is still unanswered somehow, I figured I'd throw in my ten cents. I was wondering if you've played around with the
display:block
/display:inline
settings. Not fully understanding your question, I'm not exactly sure how you would do this, but I think you might want to change youriframe
to displayinginline
.UPDATED:
DEMO: http://jsbin.com/ewomi3/3/edit
HTML
CSS
NOTE: I have finally understood what you want! Use
table
tag instead of adiv
tag as container! See the demo and enjoy it!I got my double scrollbar issue solved by dynamically assign iframe's height.
StackOverflow - Dynamic change iframe height
The requirements are clear:
My solution is very simple:
overflow:hidden;
.height: calc ( 100% - 120px );
. The wrapper around the iframe can be a div or a table with a width 100% and a height 100%.Here is my example with the iframe height set to 80% (of the window):
styling:
html: