English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This article introduces the HTML iframe scrolling attribute that specifies whether a scroll bar is displayed in the <iframe>. Usually, when the content is greater than the <iframe>, a scroll bar will appear in the <iframe>.
Iframe with scroll bar:
<!DOCTYPE html> <html> <head> <title>HTML: <iframe> scrolling attribute - Basic Tutorial Website oldtoolbag.com</title> <body> <p>Always display the scroll bar:/p> <iframe src="/" width="400" height="250" scrolling="yes"> <p>Your browser does not support iframes./p> </iframe> <p>Do not display the scroll bar:/p> <iframe src="/" width="400" height="250" scrolling="no"> <p>Your browser does not support iframes./p> </iframe> <p>HTML5 The scrolling attribute is not supported, please use CSS instead.</p> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
The scrolling attribute is deprecated, but still supported in all major browsers.
HTML5 The scrolling attribute for <iframe> is not supported. Please use CSS instead.
The scrolling attribute specifies whether a scrollbar is displayed in the <iframe>.
Generally, when the content is larger than the <iframe>, a scrollbar will appear in the <iframe>.
<iframe scrolling="auto|yes|no">
Value | Description |
---|---|
auto | Display scrollbars when needed (default value). |
yes | Always display scrollbars (even if not needed). |
no | Never display scrollbars (even if needed). |