an HTML attribute for the iframe tag
  1. Welcome
  2. Examples
    1. CSS
    2. iframe
    3. React
    4. Vimeo
    5. YouTube
  3. Errors
  4. Anecdotes


  1. querySelectorAll()
  2. Questions LLC


The allowfullscreen HTML attribute can be used to embed YouTube videos. The embedded YouTube video will have a fullscreen button. Here is what the code looks like:

<iframe width="780" height="428" src="//" frameborder="0" allowfullscreen></iframe>

On a webpage, the above HTML example will look like this:

To disable the fullscreen button for a YouTube video, you can use the following code:

<iframe width="780" height="428" src="//" frameborder="0"></iframe>

And this will render like this:

Notice that the allowfullscreen HTML attribute is missing. Also, when you play the video, the fullscreen button is disabled.