Search code examples
htmliframew3c-validation

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


I'm trying to validate my website with the W3C validator but it doesn't work. I have a YouTube iframe and this is the error:

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

Screenshot:

enter image description here

And this is my index.html (cropped):

<!-- Video -->
<div class="video-container box-size">
  <iframe width="700" height="312" src="http://www.youtube.com/embed/OfUPsnAtZMI" frameborder="0" allowfullscreen></iframe>
</div>

How can I correct it?


Solution

  • As they state themselves "The frameborder attribute is not supported in HTML5. Use CSS instead."

    The equivalent of frameborder in css is border: 0px;. Add it to your iframe in css.