I would like my video element to show a title over the video while it's playing, the problem is: it doesn't work. If I switch the <video> tag to a <div> it works perfectly fine. What am I doing wrong?
My HTML markup is this:
<div class="player">
<video src="video.mp4" poster="video-poster.jpg" title="Video Name"></video>
</div>
And my CSS is this:
.player {
position: relative;
width: 852px;
height: 356px;
}
.player video {
position: relative;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: block;
}
.player video::after {
content: attr(title);
position: absolute;
top: 10px;
right: 15px;
color: #fff;
display: block;
height: 20px;
}