How to get YouTube embed code in HTML5?

My page was tested error-free against HTML5 until I add a YouTube embed code.

# Line 140, Column 132: Stray end tag param.

    …O30JM&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="tru

# Error Line 140, Column 183: Stray end tag param.

    …llowFullScreen" value="true"></param><param name="allowscriptaccess" value="a

# Error Line 140, Column 238: Stray end tag param.

    …scriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1rW

# Error Line 140, Column 430: Stray end tag embed.

    …ways" allowfullscreen="true"></embed></object>

Is there a way to get object, inline, and param tags for HTML5 validation?

+3
source share
2 answers

Remove the end tags and replace them with tags closing the closure.

Eg.

<embed ...></embed>

<embed ... />
+5
source

Adding an answer to Charlies, with more details:

The void element is embedded, i.e. it cannot have any content. Thus, it should not have a closing tag in HTML serialization.

XHTML . XML , ( ), . , .

HTML, , , . , .

, void, .

http://dev.w3.org/html5/markup/syntax.html#syntax-elements

+2

Source: https://habr.com/ru/post/1726606/


All Articles