HTML/CSSAdvanced#html#security

What is the difference between the <iframe> sandbox attribute values?

The sandbox attribute restricts an embedded iframe's capabilities by default (no scripts, forms, popups); adding tokens like allow-scripts or allow-same-origin selectively re-enables specific permissions, improving security when embedding third-party content.

Example
<iframe src="widget.html" sandbox="allow-scripts allow-forms"></iframe>

Related Questions

1
HTML/CSSIntermediate#html#performance

How do you lazy-load images natively in HTML?

Open
2
HTML/CSSAdvanced#css#layout

What is the difference between a block formatting context (BFC) and normal flow?

Open
3
HTML/CSSIntermediate#css#accessibility

What is the difference between resetting focus outlines and providing accessible focus styles?

Open