.aspect-ratio { position: relative; width: 100%; height: 300px; } .aspect-ratio iframe { position: absolute; width: 100%; height: 300px; left: 0; top: 0; }