3
我希望視頻只能在div「index -banner」中播放,但它會以整頁形式播放,直到到達頁腳。 我已經試過一切都沒有成功。materializecss - 背景中的視頻
例子:background
<!-- Video -->
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<div class="col s12 m4">
<div class="icon-block">
<h2 class="center light-blue-text"><i class="material-icons">group</i></h2>
<h5 class="center">User Experience Focused</h5>
<p class="light">Text</p>
</div>
</div>
<video autoplay loop id="bgvid">
<source src="video/fundo.webm" type="video/webm">
<source src="video/fundo.mp4" type="video/mp4">
</video>
</div>
</div>
代號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%);
}