How to add horizontal scroll bar to iframe

Viewed 23

I have this iframe

<iframe src="https://opendsa-server.cs.vt.edu/OpenDSA/Books/Everything/html/Write.html#recurWriteStepsCON" scrolling="no" id='frameid1' width=100% height=330px></iframe>

In smaller screen devices the iframe is getting cut off. So I want to add a horizontal scroll bar, but not a vertical one. How do I do it? Adding scrolling="no" removes both scroll bars.

1 Answers

I believe you can achieve it by hiding the overflow and adding the overflow-x:

<iframe style="overflow: hidden; overflow-x: scroll;" src="https://opendsa-server.cs.vt.edu/OpenDSA/Books/Everything/html/Write.html#recurWriteStepsCON" id='frameid1' width=100% height=330px></iframe>
Related