I have a video as a background which has an overlay and then some text with buttons. It displays correctly on all browsers except Safari.
Could someone please help me make it compatible?
I'm wondering if there's a solution that I can't see before I take a different approach in doing this. Also, if there is an easier approach to do what I'm trying to do, please tell me!
By the way, I'm using Bootstrap 3.3.7
body .home-page .vid-header {
position: relative;
background-position: center;
background-size: cover;
height: 100vh;
display: flex;
align-items: center;
color: #fff;
}
body .home-page .vid-header .video-wrap {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100vh;
overflow: hidden;
}
body .home-page .vid-header .video-wrap video {
flex: 0 0 100%;
}
body .home-page .vid-header .header-overlay {
height: 100vh;
width: 100vw;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #1A1F41;
z-index: 1;
opacity: 0.91;
}
body .home-page .vid-header .header-content {
z-index: 2;
text-align: center;
color: #FFF;
overflow-x: hidden;
margin: 0 auto;
}
<div class="home-page">
<div class="vid-header">
<div class="video-wrap">
<video autoplay="true" loop="true" height="1080px" width="1920px" muted>
<source src="media/video.mp4" type="video/mp4">
</video>
</div>
<div class="header-overlay"></div>
<div class="header-content">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h1 class="text-center">Text</h1>
<h4 class="text-center">Text</h4>
</div>
</div>
<div class="row">
<div class="col-lg-offset-2 col-lg-4 col-md-offset-2 col-md-4 col-sm-6 col-xs-12">
<button class="btn btn-primary btn-lg buttons h-button-second">Button</button>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<button class="btn btn-primary btn-lg buttons h-button-second">Button</button>
</div>
</div>
</div>
</div>
</div>
</div>