在 HTML 中为 <iframe> 中的内容启用一组额外的限制?

htmlweb developmentfront end technology更新于 2026/1/17 14:36:17

使用 sandbox  属性为 HTML 中 <iframe> 中的内容启用一组额外的限制。

示例

您可以尝试运行以下代码来实现 sandbox  属性 −

<!DOCTYPE html>
<html>
   <body>
      <iframe src = "new.htm" sandbox>
         <p>Your browser does not support iframes.</p>
      </iframe>
   </body>
</html>

相关文章


有用资源