Ładnie, ładnie... ale nie rób tego z kodem inline.
Dodaj to do swojego CSS;
Kod:
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
margin: 0 0 20px 0;
}
.video-container iframe,
.video-container video,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
}
I dodawaj film z YT tak:
Kod:
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/QoISYHup7hQ" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
I niczego nie zmieniaj w kodzie iframe poza wywaleniem frameborder="0" bo jest zbędne w HTML5.