1001Ferramentas
🖼️Utilities

Iframe Builder

Builds a generic <iframe> with src, width, height and optional sandbox/allow attributes.


  

Embedding one page inside another without surprises

You need to drop an external map, video or form into your page, so you copy an old iframe from another project with the wrong dimensions and attributes you never really understood. Then the annoying questions start: which values does sandbox take again? Is allow separated by semicolons or commas? This builder assembles the whole tag as you type, so you see the markup before pasting it into your HTML.

There is nothing clever under the hood: the five fields become a string with src, width, height and, when filled in, sandbox and allow. One behaviour deserves attention. Leaving the Sandbox field empty drops the attribute entirely, and an iframe without sandbox can run scripts, submit forms and navigate freely. Meanwhile sandbox with an empty value is the single most restrictive setting in HTML, and this builder cannot emit that empty form.

Before pasting, check whether the target site allows framing at all: if it sends X-Frame-Options DENY or a frame-ancestors directive in its CSP, the frame renders blank and no attribute on your side fixes it. Add a title attribute by hand for screen readers, plus loading set to lazy when the frame sits below the fold. Watch out for double quotes inside the fields, since they close the attribute and break the tag. Everything runs in your browser.

Frequently asked questions

Why does my iframe show up blank?
Almost always the embedded site blocks framing through the X-Frame-Options header or a frame-ancestors rule in its Content-Security-Policy. That decision lives on the destination server, so no attribute on your page works around it.
Which sandbox values should I use?
The common ones are allow-scripts, allow-same-origin, allow-forms, allow-popups and allow-modals, separated by spaces. Pairing allow-scripts with allow-same-origin on third-party content defeats much of the point, because the embedded script can then strip its own sandbox.
Can I set the width as a percentage?
The builder writes whatever you type straight into the attribute, so width equal to 100% does come out. For responsive layouts it still reads better to keep pixel attributes and size the frame with CSS.

Related Tools