video {
width: 100%;
z-index: 1;
position: fixed;
}
我试过这个,它工作正常,但它固定在全身......
最佳答案
你应该设置你的选择器,例如:
#headerid video {
width: 100%;
z-index: 1;
position: fixed;
}
它将修复 headerid 元素中的视频。可以是div,但是你必须固定div的宽度和高度。
关于javascript - Html5 和 CSS 不固定附件的背景视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49222727/