0

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

Ale-Jandra
  • 83
  • 5

3 Answers3

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
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
  • How can I fix it if that's the case? – Ale-Jandra Jul 30 '17 at 21:08
  • 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