Created
October 2, 2023 01:53
-
-
Save kdaisho/586dec414f79cf3abb9b70896b909976 to your computer and use it in GitHub Desktop.
responsive layout - iframe
This file contains hidden or 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
<style> | |
/* scss */ | |
.iframe-container { | |
overflow: hidden; | |
position: relative; | |
width: 100%; | |
&:after { | |
content: ''; | |
display: block; | |
padding-top: 56.25%; | |
} | |
iframe { | |
left: 0; | |
position: absolute; | |
top: 0; | |
width: 100%; | |
height: 100%; | |
} | |
} | |
</style> | |
<div class='iframe-container'> | |
<iframe | |
style='border:0;' | |
src='https://www.youtube.com/embed/nKIu9yen5nc?start=149' | |
width={IFRAME.WIDTH} | |
height={IFRAME.HEIGHT} | |
frameborder='0' | |
></iframe> | |
</div> | |
<script> | |
const IFRAME = { | |
HEIGHT: 382, | |
WIDTH: 680, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment