html - “The frameborder attribute on the iframe element is obsolete. Use CSS instead.”

标签 html iframe w3c-validation

我正在尝试使用W3C验证器来验证我的网站,但是它不起作用。我有一个YouTube iframe,这是错误消息:

The frameborder attribute on the iframe element is obsolete. Use CSS instead.


屏幕截图:
enter image description here
这是我的index.html(已裁剪):
<!-- Video -->
<div class="video-container box-size">
  <iframe width="700" height="312" src="http://www.youtube.com/embed/OfUPsnAtZMI" frameborder="0" allowfullscreen></iframe>
</div>
我该如何纠正?

最佳答案

他们指出:“HTML5不支持frameborder属性。请改用CSS。”

CSS中的frameborder等效于border: 0px;。将其添加到CSS中的iframe中。

关于html - “The frameborder attribute on the iframe element is obsolete. Use CSS instead.”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26274082/

相关文章:

Asp.net 链接运行服务器 w3c 验证器

javascript - 选择窗口 html

javascript - Material Design Lite Table - 动态添加行打破格式

javascript - Fancybox 2 beforeLoad 和 afterClose 在事件时不触发隐藏/显示 div

html - iFrame 问题和溢出 :hidden in IE11

w3c-validation - 完整网站的W3C验证

c# - HTML 到图像 .tiff 文件

jQuery .submit() 不触发

jquery - 如何将外部样式表和 javascript 导入 iframe

html - 在 W3C 验证器中验证 HTML 时如何获取徽章?