allowfullscreen

an HTML attribute for the iframe tag
  1. Welcome
  2. iframe
  3. YouTube
  4. Examples
  5. Errors
  6. Anecdotes
  7. Questions (11)

Welcome

allowfullscreen is an HTML attribute for the iframe tag. It enables videos from various sources to be displayed in fullscreen mode. Without it, videos would only be visible within iframes, and that would be no fun whatsoever.

The following HTML code, when inserted into a webpage, displays a YouTube video with a fullscreen button:

<iframe width="780" height="428" src="http://www.youtube.com/embed/xDMP3i36naA" frameborder="0" allowfullscreen></iframe>

Here is what the code looks like when displayed to a user. Once the video is played, a fullscreen button is displayed in the bottom-right hand corner: