我需要在视频上显示播放按钮。我试过使用z-index。但它似乎不起作用。下面是html代码
html:
<!DOCTYPE html>
<html>
<head>
<title>text</title>
<link rel="stylesheet" href="test.css">
</head>
<body style="overflow: hidden; margin: 0px;">
<div id="d1">
<video id="videoID" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" autoplay>
<div id="d2">
<h1 id="h">I am heading</h1>
<!--<button type="button" id="play-pause" class="play">Play</button>-->
</div>
</div>
</body>
</html>
CSS:
#d1
{
font-family: 'Avenir', Helvetica, Arial, sans-serif;
color: #2c3e50;
margin-top: 10px;
width: 55%
}
#videoID
{
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
}
#d2 {
position: absolute;
width: 100%;
height: 100%;
z-index: 15;
left: 100px;
top: 100px;
}
“位置:绝对”应在视频顶部显示标题。它不起作用。我把d2的z指数加到了15。但还是没用。我无法在视频上显示该按钮。如果有任何问题以及如何解决,请任何人帮助我。