html中scrolling的作用是什么

html中scrolling的作用是什么?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

在html中,scrolling的中文意思为“滚动”;它是iframe标签的一个属性,用于规定是否在iframe中显示滚动条,语法格式“<iframe scrolling="值">”,可设置的属性值有auto、yes、no。

html中scrolling的作用是什么

HTML <iframe> 标签的 scrolling 属性

scrolling 属性规定是否在 iframe 中显示滚动条。默认地,如果内容超出了 iframe,滚动条就会出现在 iframe 中。

语法格式:

<iframe scrolling="value">
属性值 描述
auto 在需要的情况下出现滚动条(默认值)。
yes 始终显示滚动条(即使不需要)。
no 从不显示滚动条(即使需要)。

示例:

<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
	</head>

	<body>

		<p>显示滚动条的 iframe:</p>
		<iframe src="https://www.php.cn" width="200" height="200" scrolling="yes">
   <p>您的浏览器不支持  iframe 标签。</p>
</iframe>

		<p>没有滚动条的 iframe :</p>
		<iframe src="https://www.php.cn" width="200" height="200" scrolling="no">
   <p>您的浏览器不支持  iframe 标签。</p>
</iframe>

	</body>

</html>

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注行业资讯频道,感谢您对亿速云的支持。