I have an iframe.
I need a cross-browser solution to ensure that only the vertical scrollbar is visible, regardless of the width of the iframe's contents.
My solution already has a dependency on jQuery, so if this is not possible with only CSS I am open to jQuery solutions.
How can I do this?
this works for me (even on safari too):
<iframe src="http://url/file.html" frameborder="0" style="overflow-y:scroll !important; overflow-x:hidden !important; overflow:hidden;height:100%;width:100%;" scrolling="yes"></iframe>
Or you can do this too:
CSS
iframe {
overflow-y:scroll !important;
overflow-x:hidden !important;
overflow:hidden;
height:100%; /* optional */
width:100%; /* optional */
border:none; /* optional */
}
HTML
<iframe src="http://url/file.html" scrolling="yes"></iframe>
*src (http://url/file.html), needs to point to a valid URL and HTML file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With