bsm bsm - 1 year ago 75
HTML Question

How to add scrollbars in iframe

I want to add scrollbars in my iframe. Below is my code.

<iframe src="" width="1349px" height="100%" scrolling="auto">


I am writing this in Drupal 7. Problem is it doesn't show iframe with scrollbars and border. Earlier I simply set the source without width and height and scrolling options and it showed iframe with scrollbars but after adding width and height,it disappeared.


Answer Source

scrolling="yes" and also frameborder aren't valid HTML5 attributes anymore. They can't be found in the list of allowed attributes, see: W3C: 4.7.6. The iframe element or MDN: <iframe>.

Use CSS instead:

iframe {
    overflow: scroll;
    width: 1349px;
    height: 100%;
    border: 1px solid black;

But actually all browsers show the scrollbars right away if needed.


Try before buy

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download