Open In App

HTML <iframe> scrolling Attribute

Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <iframe> scrolling Attribute is used to specify whether the scrollbar will be displayed or not in the <Iframe> Element. Basically, the scrollbar is used when the content is larger than the Iframe Element. 

Note: This attribute has been DEPRECATED and is no longer recommended.

Syntax 

<iframe scrolling="auto | yes | no">

Attribute Values 

Attribute Values

Description

auto

It has a default value. The scrollbar appears when needed.

yes

This value shows the scrollbar in the Iframe Element.

no

This value does not show the scrollbar in the Iframe Element.

Example: the implementation of  <iframe> scrolling Attribute

html




<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            text-align: center;
        }
    </style>
</head>
 
<body>
    <h1 style="color: green;">
        GeeksForGeeks
    </h1>
    <h2>
        HTML Iframe scrolling Attribute
    </h2>
 
    <p>Content goes here</p>
 
            height="300" width="400"
            marginwidth="50" scrolling="yes">
    </iframe>
 
</body>
 
</html>


Output:

rty Example 2: the implementation of <iframe> scrolling with no scrolling attribute.

HTML




<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            text-align: center;
        }
    </style>
</head>
 
<body>
    <h1 style="color: green;">
        GeeksForGeeks
    </h1>
    <h2>
        HTML Iframe scrolling Attribute
    </h2>
 
    <p>Content goes here</p>
 
            height="300" width="400"
            marginwidth="50" scrolling="no">
    </iframe>
 
</body>
 
</html>


Output:

Screenshot-2023-12-20-092336

Supported Browsers:

  • Google Chrome 1
  • Microsoft Edge 12
  • Firefox 1
  • Opera 15
  • Safari 4


Last Updated : 12 Jan, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads