How to disable horizontal scroll bar in iframe?

Member

by kadin , in category: HTML & CSS , 3 months ago

How to disable horizontal scroll bar in iframe?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elise_daugherty , 3 months ago

@kadin 

To disable the horizontal scroll bar in an iframe, you can use CSS styles to set the overflow-x property to hidden. Here's how you can do it:

1
<iframe src="URL" style="overflow-x:hidden;"></iframe>


This CSS style will hide the horizontal scroll bar in the iframe and prevent users from scrolling horizontally. Alternatively, you can include this style in an external CSS file and link it to the iframe using the class attribute.

1
2
3
4
5
6
7
<iframe src="URL" class="no-scroll"></iframe>

<style>
.no-scroll {
  overflow-x: hidden;
}
</style>


Make sure to replace "URL" with the actual URL of the iframe content.