JSFiddle - React, Tailwind, and code Playground

by Michal Vodicka

HTML

<p>try to resize iframe ;) <span id="iframe-size"></span></p>
<iframe id="myiframe" src="https://jsfiddle.net/windkiller/0ekeurbz/show">
</iframe>

CSS

iframe {
  height: 300px;
  width: 300px;
  resize: both;
  overflow: auto;
  background-color: #FDD;
  border: 0;
  transform: scale(2, 2);
  transform-origin: 0 0;
}

JavaScript

(function() {
	var el = document.getElementById("iframe-size");
	var iframe = document.getElementById("myiframe");
  el.innerHTML = iframe.getBoundingClientRect().width + "x" + iframe.getBoundingClientRect().height;
})();