I am using the following code to make my video’s size responsive.
.embed-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
max-width: 100%;
}
.embed-container iframe,
.embed-container object,
.embed-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
But I want the video to be half of the page wide. As soon as I change the widths and heights to 50%, the container is still as high as before. Do anyone know why the container is not resizing it’s height to the inner video?
.video-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
max-width: 50%; <---
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50%; <---
}
Or is there maybe an easier way for the “video” field?
Thanks in advance!