Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI

CodeMyUI/index.html

Created Feb 3, 2018
Embed
What would you like to do?
Scalable iframe with reproCSS
<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>
<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
You can’t perform that action at this time.