The HTML allowfullscreen attribute
Quick answer
The HTML allowfullscreen attribute allows the framed content to enter fullscreen via the Fullscreen API. It is used on the <iframe> element.
Overview
The allowfullscreen attribute lets an iframe go fullscreen. It is used on the <iframe> element.
It configures embedded content: what is embedded, what capabilities it is granted, and how it is sandboxed. With third-party content, these attributes are your main security controls.
Syntax
<iframe src="player.html" allowfullscreen></iframe>
Values
| Value |
|---|
| A boolean attribute: present or absent. |
Best practices
Frequently asked questions
What does the allowfullscreen attribute do?
Lets an iframe go fullscreen.
How do I make an iframe secure?
How do I embed inline HTML in an iframe?
Which elements use the allowfullscreen attribute?
It is an element-specific attribute, used on the
<iframe> element.