【发布时间】:2022-02-02 11:36:55
【问题描述】:
这是我第一次在这里提出问题,并且在使用 adobe XD 进行设计后实际上开始从头开始制作我自己的网站。所以基本上我得到了这个带有背景视频和一些文字的英雄部分,我想在下面添加内容,但是当我尝试时,内容一直直接出现在视频前面。我很确定我的代码是错误的,我很抱歉写得不好,但我想理解,这样我才能变得更好。另外,我用法语做网站只是为了不让任何人感到困惑。谢谢!
[现在的网站][1] : https://i.stack.imgur.com/4FdTX.jpg
[我最终想做什么][2] :https://i.stack.imgur.com/Hp8cN.jpg
<!--Background video-->
<section id="hero-video">
<video autoplay loop muted poster="/Images/cf_poster.jpg">
<source src="Videos/slideshow.mp4" type="video/mp4">
</video>
</section>
<!--Start of header-->
<section class="header">
<nav>
<a href="Index.html" id="logo"><img src="Images/cflogo_main.png"></a>
<div class="nav_links" id="navLinks">
<i class="fa fa-window-close" onclick="hideMenu()"></i>
<ul>
<li><a href="">Le collège</a></li>
<li><a href="">Vie scolaire</a></li>
<li><a href="">Services</a></li>
<li><a href="">Portail</a></li>
<li><a href="">Admission</a></li>
</ul>
</div>
<i class="fa fa-bars" onclick="showMenu()"></i>
</nav>
<!--End of header-->
<div class="hero-text">
<h1>Un grand collège <br> laisse sa marque pour la vie</h1>
<a href='' class="hero-btn">Visite virtuelle</a>
</div>
</section>
<!--Section that i want to add under-->
<section class="avantages">
<h3>Place texte here</h3>
</section>```
CSS
#hero-video {
object-fit: cover;
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
}
.avantages {
background: white;
margin: auto;
text-align: center;
padding:1rem;
position: relative;
}
【问题讨论】:
标签: html css background html5-video