SyntaxStudy
Sign Up
HTML Controlling iframe Scrolling
HTML Beginner 3 min read

Controlling iframe Scrolling

iframe Scrolling

By default iframes show scrollbars when content overflows. Control scrolling with CSS overflow properties applied to the iframe element.

The scrolling attribute is deprecated — use CSS instead.

Example
<!-- CSS approach (preferred) -->
<iframe
  src="content.html"
  style="overflow: hidden; border: none;"
  title="No scroll frame"
></iframe>

/* Or in stylesheet */
iframe.no-scroll {
  overflow: hidden;
  scrollbar-width: none;
}
Pro Tip

Hiding iframe scrollbars can trap users if content exceeds the iframe height — ensure sizing is sufficient.