我試圖讓圖像顯示在視頻上,但它甚至沒有出現在視頻下。左上角有一些空白區域,但圖像也沒有出現在那裏。只有當我將視頻的HTML代碼發送出去時,圖片纔會顯示出來。HTML:視頻z-index不起作用
<html>
<style type="text/css">
#sampleVideo {
position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
}
#sampleImage {
z-index: 40;
}
</style>
<body>
<video id="sampleVideo" src="sample.mp4" autoplay/>
<script type="text/javascript">
video = document.getElementById("sampleVideo");
</script>
<img id="sampleImage" src="enter site.png">
</body>
</html>
http://stackoverflow.com/questions/13388537/html5-video-ignoring-z-index –