Embed a YouTube Video in HTML and CSS

Description

The following code shows how to embed a YouTube Video.

Example


<html>
<body>
<!--   w ww.j  av a  2  s  .c o m-->
<h1>Embedding a YouTube Video</h1>

<object width="425" height="344">
<param name="movie"
value="http://www.youtube.com/v/dMH0bHeiRNg&hl=en&fs=1">
</param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/dMH0bHeiRNg&hl=en&fs=1"
type="application/x-shockwave-flash"
allowscriptaccess="always"
allowfullscreen="true"
width="425"
height="344"></embed>
</object>



</body>

</html>

Click to view the demo

The code above generates the following result.

Embed a YouTube Video in HTML and CSS
Home »
  HTML CSS Tutorial »
    Introduction »
      Media
HTML CSS Tutorial Media
Add a flash movie in HTML and CSS
Add an MP3 without specifying player in HTM...
Embed a YouTube Video in HTML and CSS
Provide Multiple Audio Formats in HTML and ...
Use audio element embeds audio content in H...