I want to place an image and a video face to face, with the same dimensions. The image is 16:9 aspect ratio, so the iframe video should be the same. And both elements should be responsive.
How can I do that?
Here is my try, without success:
.wrap {
text-align: justify;
text-align-last: justify;
}
.imgt {
display: inline-block;
width: 45%;
}
.imgt {
display: inline-block;
width: 45%;
}
.framewrap {
display: inline-block;
width: 45%;
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
background: gold;
}
.iframetop {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 55%;
}
<div class='wrap'>
<img class='imgt' src='https://static.pexels.com/photos/111788/pexels-photo-111788-large.jpeg' alt='img'>
<div class='framewrap'>
<iframe class='iframetop' src="https://www.youtube.com/embed/N4zVExS5mgg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>