How do I hide (and color) the iframe scrollbar in Firefox and Internet Explorer with css or Javascript? I am using height auto iframe content and it is working fine but scrollbar is showing (except in Chrome). I am using iframe height auto for cross domain height auto.
-
Why would you hide it and colour it at the same time? – Ming Jan 31 '14 at 06:33
-
Welcome to Stack Overflow! It's generally easier to answer questions like this if you provide the code that you have so far. – seaotternerd Jan 31 '14 at 06:42
-
No i am saying color is optional – Mohammed Javed Jan 31 '14 at 07:16
2 Answers
I recall having a similar issue a while back , depending on your needs I would try using :
overflow-y:hidden;
in the css or the
scrolling="no"
inside the iframe element. ( This should work)
If all else fails , here's a little hack , set the parent div slightly smaller width than the child div and set its css like so:
.parent {
overflow-x:hidden;
width:486px;
height:300px;
}
.child {
width:500px;
height:auto;
}
Then to make it look even slightly better play with the css eg: set the border right and it will look as though you never did such a hack , but as i said before , try the scrolling="no" first , as this latter method would probably be frowned upon by some, however in my defense it is a solution to a problem.
Happy Coding.

- 1,557
- 1
- 16
- 25
If you have a script that's taking care of the height so you don't need to scroll, you can simply turn scrolling off so they're not there, getting in the way:
<iframe src="//www.abc.net.au/" scrolling="no" width="500" height="500"></iframe>
scrolling="no"
does the trick.
Example: http://jsfiddle.net/rt2bf/

- 4,468
- 1
- 21
- 21
-
In the fiddle there's no scrollbars when `scrolling="no"` is added. If you're seeing a different result, can we have a look at your code, in a fiddle, or at your site where this is happening? – Ming Jan 31 '14 at 07:15