如何用HTML5 CSS视频替换Div背景
目前有一个拥有自己背景的div,正在努力使用CSS将背景设置为视频 当前设置如下所示: DIV的CSS:如何用HTML5 CSS视频替换Div背景,css,html,video,Css,Html,Video,目前有一个拥有自己背景的div,正在努力使用CSS将背景设置为视频 当前设置如下所示: DIV的CSS: .intro-header { padding-top: 50px; /* If you're making other pages, make sure there is 50px of padding to make sure the navbar doesn't overlap content! */ padding-bottom: 50px; text-align: center;
.intro-header {
padding-top: 50px; /* If you're making other pages, make sure there is 50px of padding to make sure the navbar doesn't overlap content! */
padding-bottom: 50px;
text-align: center;
color: rgb(255, 255, 255);
background: url(../img/intro-bg.jpg) no-repeat center center;
background-size: cover;}
<div class="intro-header">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="intro-message">
<h2>Welcome To Little Mountain Media</h1>
<h1>WE BELIEVE IN THE POWER OF VISUAL MEDIA</h3>
<hr class="intro-divider">
</div>
</div>
</div>
</div>
</div>
DIV的HTML:
.intro-header {
padding-top: 50px; /* If you're making other pages, make sure there is 50px of padding to make sure the navbar doesn't overlap content! */
padding-bottom: 50px;
text-align: center;
color: rgb(255, 255, 255);
background: url(../img/intro-bg.jpg) no-repeat center center;
background-size: cover;}
<div class="intro-header">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="intro-message">
<h2>Welcome To Little Mountain Media</h1>
<h1>WE BELIEVE IN THE POWER OF VISUAL MEDIA</h3>
<hr class="intro-divider">
</div>
</div>
</div>
</div>
</div>
欢迎来到小山传媒
我们相信视觉媒体的力量
正如您所看到的,非常简单,只需要一个视频来代替into-bg.jpg
谢谢有很多方法。一个是使用。jQuery是一个JavaScript框架,它包含许多有用的函数,可以使JavaScript开发更快、更容易
<script src="jquery-2.1.3.min.js"></script>
可能重复的问题:有没有关于如何使用上述代码实现的想法,我在努力做什么>@Guillermo