recentpopularlog in

Copy this bookmark:





to read

bookmark detail

A Guide to Responsive CSS Video Background | Red Stapler
html,body {
width:100vw;
height: 100vh;
margin: 0;
}
#videoBG {
position:fixed;
z-index: -1;
}
@media (min-aspect-ratio: 16/9) {
#videoBG {
width:100%;
height: auto;
}
}
@media (max-aspect-ratio: 16/9) {
#videoBG {
width:auto;
height: 100%;
}
}
@media (max-width: 767px) {
#videoBG {
display: none;
}
body {
background: url('poster.jpg');
background-size: cover;
}
}
responsive  fullscreen  video  background  HTML5 
6 weeks ago by ference
view in context