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:
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?
The frameborder attribute specifies whether or not to display a border around a frame. Tip: For practical reasons, it may be better not to specify borders, and use CSS to apply border styles and color instead. CSS Example: frame borders.
The HTML Iframe frameborder Attribute is used to specify whether or not to display the border around the content of an <Iframe> Element. Syntax: <iframe frameborder="1 | 0"> Attribute Values: 0: It has a Default value. It sets the border on one state.
The HTML <frame> frameborder attribute is used to specify whether or not a border should be displayed between the frames. For this, we use two values 0 and 1, where 0 defines no border and 1 defines the border. Note: This attribute is depreciated from HTML 5.
HTML 5 doesn't support attributes such as frameborder, scrolling, marginwidth, and marginheight (which were supported in HTML 4.01).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With