How to remove iframe scrollbars?


by denis , in category: Javascript , 7 months ago

How to remove iframe scrollbars?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by herminia_bruen , 7 months ago


To remove the scrollbars from an <iframe> element, you can use the scrolling attribute or use CSS styling.

Method 1: Using the scrolling attribute

<iframe src="your_source_url" scrolling="no" frameborder="0"></iframe>

Setting the scrolling attribute to "no" will prevent the scrollbars from showing.

Method 2: Using CSS styling You can use CSS to remove the scrollbars:

iframe {
    overflow: hidden;

This CSS rule sets the overflow property to hidden, which hides any content that exceeds the dimensions of the iframe.

Note: The above methods will work if you have control over the iframe source. If the iframe content is on a different domain, you may encounter security restrictions that prevent you from modifying its appearance.