I have an iframe in my website which appear with a horizontal scrollbar. I can't remove this scrollbar. I have tried overflow: hidden
and scrolling= no
Asked
Active
Viewed 330 times
0

Ale-Jandra
- 83
- 5
3 Answers
1
Try scrolling="no"
you should add double quotes around the no
and also add a height and width to it
0
Try overflow-x: hidden
. That might fix it.

C. Lightfoot
- 529
- 1
- 5
- 24
-
You have tried `overflow-x` and not just `overflow`? – C. Lightfoot Jul 30 '17 at 20:55
-
Did you look at this question and try these answers? https://stackoverflow.com/questions/3448265/remove-iframe-horizontal-scrollbar – C. Lightfoot Jul 30 '17 at 20:57
0
Could it be that the thing showing the scrollbar is not the <iframe>
but one of the components on the document being loaded inside?
If the content of the iframe is not responsive, it is most likely that this is the cause of you not being able to make it disappear, since CSS (as far as I know) can't control the styles of the document inside an iframe.

Enrique Moreno Tent
- 24,127
- 34
- 104
- 189
-
-
Either you get control on the original document, and change the CSS, or you use JS to access the document inside the iframe, and you change the stylesheets used by it. Reference: https://stackoverflow.com/questions/583753/using-css-to-affect-div-style-inside-iframe – Enrique Moreno Tent Jul 30 '17 at 21:10
-
Is there a way to fix it if I don't own the page the iframe's content comes from? – Ale-Jandra Jul 30 '17 at 21:28
-
For the 2nd solution I have you on my last comment, you do not need to own it. – Enrique Moreno Tent Jul 31 '17 at 12:03
-
I tried using `iframe.contentWindow` and I got the following error: `Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.` – Ale-Jandra Jul 31 '17 at 19:23