<div class="wrap">
<video autoplay muted loop playsinline>
<source src="https://previews.customer.envatousercontent.com/h264-video-previews/63d3e475-cd5d-4251-bf47-bf256bd0e441/51338459.mp4" media="(max-width: 1000px)" />
<source src="https://previews.customer.envatousercontent.com/h264-video-previews/eb992654-6121-40c0-890f-70e75afc2556/51341778.mp4" media="(min-width: 1000px)" />
I'm sorry; your browser doesn't support HTML video.
</video>
</div>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.wrap {
position: relative;
display: flex;
width: 100%;
height: 100vh;
}
video {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
object-fit: cover;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.