html - Make box that fits video in aspect ratio, plus static sized footer -


i want have looks bit this:

basic video container

where bear image in middle video. div contains video should 16:9, , footer should static height , 100% width.

although have found handy little mixin matching aspect ratio, having trouble reconciling statically sized bottom part.

to start video container, had following:

<div class="container">   <div class="content">     <video src="http://www.w3schools.com/html/movie.mp4" autoplay />   </div> </div> 

with following (s)css:

.container {   position: relative;    &::before {     display: block;     content: "";     width: 100%;     padding-top: 56.25%;  // 16:9   }    & > .content {     top: 0;     left: 0;     right: 0;     bottom: 0;     position: absolute;   } } 

how add statically sized bar bottom of box maintains aspect ratio?

for convenience of answering, here codepen more or less have

the outer container has height of 0, it's padding stretches around video saran wrap.

snippet

html {    font: 400 16px/1.428 consolas;    box-sizing: border-box  }    html,  body {    height: 100%;    width: 100%;  }    *,  *::after,  *::before {    box-sizing: inherit;    margin: 0;    padding: 0;    border: 0 none transparent;  }    .vwrap {    border: 0 none transparent;    position: relative;    padding-bottom: 56.25%;    height: 0;    overflow: hidden;  }    .vid {    position: absolute;    width: 100%;    height: auto%;    max-height: 96%;    left: 0;    top: 0;  }    footer {    width: 100%;    height: 40px;    clear: both;    position: relative;  }
<div class='vwrap'>    <video id='vid1' class='vid' src='http://media6000.dropshots.com/photos/1381926/20170326/005611.mp4' controls>    </video>  </div>  <footer class='footer'></footer>


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -