誰にでも良い日! バックグラウンドビデオに関する質問がありますが、ページ全体に添付していますが、上部に埋め込む必要があります。誰が問題があるのか教えていただけますか? 大きな感謝! HTML:背景ビデオCSS(フルスクリーンではない)
<video autoplay loop poster="video-bg.jpg" id="bgvid">
<source src="video-bg.webm" type="video/webm">
<source src="video-bg.mp4" type="video/mp4">
</video>
CSS:
video#bgvid {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(video-bg.jpg) no-repeat;
background-size: cover;
}
@media screen and (max-device-width: 800px) {
html {
background: url(video-bg.jpg) #000 no-repeat center center fixed;
}
#bgvid {
display: none;
}
}
トップに埋め込む必要がありますか? –