allowfullscreen
an HTML attribute for the iframe tag

What does allowfullscreen do?

Answers:

  • The allowfullscreen attribute in HTML is used with the <iframe> tag to specify that the content being displayed within the iframe can be shown in full-screen mode. This is particularly useful for embedding videos, maps, or other multimedia content that benefit from a full-screen experience.

    When the allowfullscreen attribute is present, it typically enables users to switch to full-screen mode, usually through a full-screen button provided by the embedded content (like a video player). Without this attribute, full-screen functionality may be disabled, and the user wouldn't be able to expand the iframe content to fill the entire screen.

    Here's an example of how it is used:

    <iframe src="https://www.example.com/video" allowfullscreen></iframe>
    

    In this example, the iframe that embeds a video from example.com can be expanded to full screen if the user chooses to do so.

Related Questions: