gpt4 book ai didi

html - 你能弄清楚为什么第 2 节在视频后面吗?

转载 作者:行者123 更新时间:2023-11-28 19:18:44 24 4
gpt4 key购买 nike

第 2 部分在我的视频背景后面。调整浏览器大小会使一切变得困惑。

我真的不懂 CSS,所以?

HTML:

<body>
<script src="Assets/main.js" type="text/javascript"></script>

<!-- The video -->
<video autoplay muted id="myVideo">
<source src="Images/banner.mp4" type="video/mp4">
</video>

<div class="content">

<h1>
<a href=""
class="typewrite"
data-period="1800"
data-type='["hi", "I'm james", "I am creative", "I enjoy designing stuff", ""]'>

<span class="wrap"></span>
</a>
</h1>

<a href="#section2">"*"</a>
</div>

<div>
<h2 id="section2"> Section 2 <br> jb <br> jb <br> jb<br> jb<br> jb<br> jb<br> jb<br> jb<br> jb<br> jb</h2>
</div>
</body>

我有它,所以一些文本会在视频上打出一些小句子。

CSS:

body {
background-color: black;
text-align: center;
color: #FFF;
/* padding-top: 10em; */
}
* {
color: #FFF;
text-decoration: none;
font-family: 'CustomFont';
font-weight: 80;
font-size: 80px;
}

#slide {
background-color: red;
padding: 0;
position: absolute;
}

/* Style the video: 100% width and height to cover the entire window */
#myVideo {
position: absolute;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
overflow: hidden;
}

/* Add some content at the bottom of the video/page */
.content {
overflow: hidden;
position: absolute;
font-size: 800;
font-family: 'CustomFont';
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

color: #F1F1F1;
width: 100%;
padding: 0px;
}

最佳答案

视频标签默认在其他元素之上,您可以通过以下方式将其发送到后面:

#myVideo {
z-index: -1;
}

body {
background-color: black;
text-align: center;
color: #fff;
/* padding-top: 10em; */
}

* {
color: #fff;
text-decoration: none;
font-family: 'CustomFont';
font-weight: 80;
font-size: 80px;
}

#slide {
background-color: red;
padding: 0;
position: absolute;
}


/* Style the video: 100% width and height to cover the entire window */

#myVideo {
position: absolute;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
overflow: hidden;
}

/* Add some content at the bottom of the video/page */

.content {
overflow: hidden;
position: absolute;
font-size: 800;
font-family: 'CustomFont';
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #f1f1f1;
width: 100%;
padding: 0px;
}

#myVideo {
z-index: -1;
}
<script src="Assets/main.js" type="text/javascript"></script>

<!-- The video -->
<video autoplay muted id="myVideo">
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
<div class="content">
<h1>
<a href="" class="typewrite" data-period="1800" data-type='[ "Hi", "I'm james", "I am creative", "I enjoy designing stuff", "" ]'>
<span class="wrap"></span>
</a>
</h1>
<a href="#section2"> "*" </a>
</div>

<div>
<h2 id="section2"> Section 2 <br> jb <br> jb <br> jb<br> jb<br> jb<br> jb<br> jb<br> jb<br> jb<br> jb</h2>
</div>

也可以看看here .

关于html - 你能弄清楚为什么第 2 节在视频后面吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57768805/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com