Answers for "youtube width height dynamic"

1

embed youtube video auto height

<!-- CSS -->
<style>
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
</style>


<!-- HTML -->
<div class="video-container">
    <iframe width="560" height="315" src="https://www.youtube.com/embed/_TyJeKKQh-s?controls=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    </div>
Posted by: Guest on June-09-2020

Code answers related to "youtube width height dynamic"

Browse Popular Code Answers by Language