Automatic height when embedding a YouTube video?
This article contains a good answer, copied below. CSS: .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%; } Example 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> How this works: The … Read more