CoderDude
CoderDude

Reputation: 13

how to display a site in a iframe in html

Why does this code not display the YouTube site or other sites like Pandora:

<html>
    <body>
        <iframe src="https://www.youtube.com"></iframe>
    </body>
</html>

Upvotes: 1

Views: 73

Answers (1)

Kai L&#252;ck
Kai L&#252;ck

Reputation: 197

The reason is, that youtube doesn´t allow that way of access. Just with an embed code, like:

<html>
    <body><iframe width="640" height="360" src="http://www.youtube.com/embed/M7lc1UVf-VE" frameborder="0"/>
    </body>
</html>

This will work, but whole youtube can´t be embedded.

Have a nice day.

Upvotes: 1

Related Questions