2

How can I have full height on my iframe, so I dont have a scrollbar if it exceeds the specified height: 500px; - I want to only have the page scrollbar existing and not the iframe scrollbar.

I know you can hide the scrollbar, but then you cannot see all the content in the iframe.

How can you do this?

width: 100% works perfectly, but height: 100% wont.

Check http://jsfiddle.net/5PKqf/

If it worked it should have shown the whole website in the iframe

Karem
  • 17,615
  • 72
  • 178
  • 278
  • Rather than what you are stating, it would be far easier to disable the main page's scrollbars than the iframe's - you can then rely on the user using the iframe scrollbars as if they were the main page ones. You can do this with `overflow:hidden` on your `html` and `body` elements oh and make sure you reset margin and padding for both those elements too. – Pebbl Nov 25 '12 at 20:41
  • possible duplicate of [Resize iframe height according to content height in it](http://stackoverflow.com/questions/525992/resize-iframe-height-according-to-content-height-in-it) – Joel Peltonen Feb 05 '15 at 07:00

1 Answers1

1

give html a height: 100%

html{ height: 100%; }
Chanckjh
  • 2,587
  • 2
  • 22
  • 28
  • 1
    +1 but you'll need all parents to the target element to have height 100%, so in this case `body` as well as `html`. – Pebbl Nov 25 '12 at 17:13
  • Hmm but check this: http://jsfiddle.net/5PKqf/3/ There's two scrollbars, thats not what i wish, i wish only 1 scrollbar where the page gets bigger depending on the iframe page – Karem Nov 25 '12 at 17:19
  • oke go to this link http://stackoverflow.com/questions/525992/resize-iframe-height-according-to-content-height-in-it – Chanckjh Nov 25 '12 at 17:24