Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Youtube Embed not showing up Reply To: Youtube Embed not showing up

#177571
Senff
Participant

I see the video embedded in your pen, but the question is — do you want to show a thumbnail or an embedded video?

To show a YouTube video’s thumbnail on your page, use any of these:
<img src="http://img.youtube.com/vi/6v7W513Wj3g/0.jpg">
<img src="http://img.youtube.com/vi/6v7W513Wj3g/1.jpg">
<img src="http://img.youtube.com/vi/6v7W513Wj3g/2.jpg">
<img src="http://img.youtube.com/vi/6v7W513Wj3g/3.jpg">

To show a YouTube video itself on your page, use this:

<iframe width="200" height="100" src="//www.youtube.com/embed/6v7W513Wj3g" frameborder="0"></iframe>

Note though, that this embed code will NOT work when you run your page straight from your hard drive (and not through a webserver). Because it will then not use http or https, it will not know how to get the YouTube video, so you’ll have to use this:

<iframe width="200" height="100" src="http://www.youtube.com/embed/6v7W513Wj3g" frameborder="0"></iframe>