A Pen by Tommy Hodgins on CodePen.
Created
February 3, 2018 05:09
-
-
Save CodeMyUI/b9b44647227350bc9c4cfec0c3e39ca8 to your computer and use it in GitHub Desktop.
Scalable iframe with reproCSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Scalable iframe</h1> | |
<iframe id="demo" width="560" height="315" src="https://www.youtube.com/embed/XreMtQz6HkY" frameborder="0" allowfullscreen></iframe> | |
<style process="load resize"> | |
#demo { | |
width: 100%; | |
height: calc(${document.querySelector('#demo').offsetWidth}px / (${demo.width}/${demo.height})); | |
} | |
</style> | |
<footer>Built with <a href=https://tomhodgins.github.io/reprocss/>reproCSS</a> </footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//rawgit.com/tomhodgins/reprocss/master/reprocss.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment