> For the complete documentation index, see [llms.txt](https://attr.sygnal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://attr.sygnal.com/sa5-html/auto-size-iframes.md).

# Auto-Size IFRAMEs 🧪

{% hint style="info" %}
UNRELEASED\
This was a part of SA4 we may revive.&#x20;
{% endhint %}

## Auto-Sizing IFrames

**This tool allows you to auto-size IFRAMES to their content.**

### DEMO - Auto-Size IFRAMEs <a href="#demo---auto-size-iframes" id="demo---auto-size-iframes"></a>

The yellow area and lipsum text below are the content of an IFRAME.

Refresh the page to generate new random lipsum text, and watch the IFRAME re-calculate the size accordingly.

The IFRAME is being auto-sized to the content it contains. In this design, it will not truncate the content, or have unnecessary padding below. It also does not require scrollbars.

Automatically sizes the IFRAME to fit its content.

**IFRAME Starts Here**

**IFRAME Ends here.**

* May not work with cross-domain content.
* May not respond to dynamic IFRAME content changes.

## Custom Src Changes

<https://codepen.io/memetican/pen/ZEjxxZP/9f48514d4c34682223a748e0288eed12>

<https://stackoverflow.com/questions/16449445/how-can-i-set-image-source-with-base64>

## ![](/files/v0kxcPolNRj7tbNOq4C8)
