How to make YouTube iframe embed full screen with HTML?

Spread the love

To make YouTube iframe embed full screen with HTML, we set the allowfullscreen attribute.

For instance, we write

<iframe
  src="your_page_url"
  allowfullscreen="allowfullscreen"
  mozallowfullscreen="mozallowfullscreen"
  msallowfullscreen="msallowfullscreen"
  oallowfullscreen="oallowfullscreen"
  webkitallowfullscreen="webkitallowfullscreen"
>
</iframe>

to set the allowfullscreen attribute to allowfullscreen to allow full screen.

We set the equivalent attributes for other browsers to allow full screen on them.

Leave a Reply

Your email address will not be published. Required fields are marked *