I have a button that I want to place in front of my video and aligned at the center of it. So I tried using position-relative to bring it in front of the video and flex to align it to the vertical and horizontal center. However, it is not working. It has the correct z index now thanks to position-relative but it is not center aligned. How can I make it work and why is flex not working here? Thanks..
<div class="row">
<div class="col-12">
<div class="mx-auto w-90 h-90">
<div id="videoWrapper" class="embed-responsive embed-responsive-16by9 darken">
<video id="videoPlayer" src="https://www.youtube.com/watch?v=P-b4SUOfn_4"
allowfullscreen controls></video>
<button class="btn btn-primary btn-lg p-2">
Watch video<i class="fa fa-caret-right" aria-hidden="true"></i></button>
</div>
</div>
</div>
</div>
And here is my css:
.btn {
position: relative;
display: flex;
align-items: center;
justify-content: center; }