Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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?

like image 474
Kevin Masson DunkDesign Avatar asked Oct 09 '14 08:10

Kevin Masson DunkDesign


People also ask

What is CSS Frameborder?

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.

What is Frameborder iframe?

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.

How do you use Frameborder attributes?

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.

Is Frameborder supported by HTML?

HTML 5 doesn't support attributes such as frameborder, scrolling, marginwidth, and marginheight (which were supported in HTML 4.01).


1 Answers

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.

like image 158
user2950291 Avatar answered Sep 19 '22 09:09

user2950291