allowfullscreen
an HTML attribute for the iframe tag

What is the purpose of allow='fullscreen'?

Answers:

  • The allow attribute in HTML, particularly when used with the <iframe> element, specifies a list of feature permissions for the embedded content. The allow='fullscreen' value specifically enables the ability for the content inside the <iframe> to be displayed in fullscreen mode.

    When you include allow="fullscreen" in an <iframe>, you're allowing the content within that frame to request fullscreen display when the user interacts with it. This is commonly used in scenarios such as video players, presentations, or any interactive content where fullscreen viewing enhances the user experience.

    Example of usage:

    <iframe src="video.html" allow="fullscreen"></iframe>
    

    In this example, if the content of video.html includes a request for fullscreen (e.g., through JavaScript), the browser will respect that request because of the allow="fullscreen" permission. If this attribute were omitted, the fullscreen feature might be disabled for the iframe content, depending on the browser's security settings.

Related Questions: