gpt4 book ai didi

HTML div 切断其他 div

转载 作者:行者123 更新时间:2023-11-28 15:45:36 25 4
gpt4 key购买 nike

你好,我有一个小网页,我的问题是 1 div 剪切掉了我的第二个 div 的一部分:

enter image description here

如您所见,3 被剪掉了,我认为这是一个 CSS 问题,但我不知道在哪里...

HTML(只有 2 个 div 的部分):

* {
cursor: none !important;
overflow: hidden;
}
.number {
height: 60%;
width: 100%;
z-index: 2;
margin: 0;
padding: 0;
text-align: center;
}
h1 {
font-size: 500pt;
margin: 0;
padding:0 background-color: transparent;
}
p {
font-size: 70pt;
margin: 0;
padding: 0;
}
.names {
position: relative;
bottom: 0;
left: 0;
z-index: -1;
margin: 0;
padding: 0;
background-color: rgba(255,255,255,0);
width: 400px;
height: 40%;
text-align: center;
}
body {
background-color: black;
color: white;
font-family: arial;
}
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.lauftext {
height: 100%;
font-size: 70pt;
}
@keyframes marquee {
0% {
text-indent: 100%
}
100% {
text-indent: -100%
}
}
@-webkit-keyframes marquee {
0% {
text-indent: 100%
}
100% {
text-indent: -100%
}
}
.lauftextdiv {
height: 100%;
}
.lauftext {
height: 200pt;
position: absolute;
font-size: 200pt;
top: 50%;
width: 100%;
margin: auto;
padding: 2px;
overflow: hidden;
white-space: nowrap;
animation: marquee 7s linear infinite;
webkit-animation: marquee 7s linear infinite;
}
@keyframes rotate {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
@-o-keyframes rotate {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
@-moz-keyframes rotate {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
@-webkit-keyframes rotate {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
.number_full {
text-align: center;
animation: rotate 7s linear infinite;
-webkit-animation: rotate 7s linear infinite;
-o-animation: rotate 7s linear infinite;
-moz-animation: rotate 7s linear infinite;
}
.number_full h1 {
text-shadow: 0 0 100px #777;
transform: rotateX(20deg);
padding: 100px;
font-size: 600pt;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name=viewport content="width=device-width" , inital-scale=1.0>
<link rel="stylesheet" href="../layouts/style.css">
<script src="../reload.js"></script>
<title>3</title>
</head>
<body>
<div class="number">
<h1>3</h1>
</div>
<div class="names"> Marc
...
</div>
</body>
</html>

最佳答案

我想您也应该向 .number 添加一个 position 属性。并尝试删除 height 属性,或将其设置为 100%

.number {
position: relative;
z-index: 2;

height: 60%;
width: 100%;

margin: 0;
padding: 0;

text-align: center;
}

* {
cursor: none !important;
overflow: hidden;
}

.number {
width: 100%;
z-index: 2;
margin: 0;
padding: 0;
text-align: center;
}

h1 {
font-size: 300pt;
margin:0;
padding:0
background-color: transparent;
}

p {
font-size: 70pt;
margin: 0;
padding: 0;
}

.names {
position: relative;
bottom: 0;
left: 0;
z-index: -1;
margin: 0;
padding: 0;
background-color: rgba(255,255,255,0);
width: 400px;
height: 40%;
text-align: center;
}

body {
background-color: black;
color: white;
font-family: arial;
}

html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}

.lauftext {
height: 100%;
font-size: 70pt;
}

@keyframes marquee {
0% { text-indent: 100% }
100% { text-indent: -100% }
}

@-webkit-keyframes marquee {
0% { text-indent: 100% }
100% { text-indent: -100% }
}

.lauftextdiv {
height: 100%;
}

.lauftext {
height: 200pt;
position: absolute;
font-size: 200pt;
top: 50%;
width: 100%;
margin: auto;
padding: 2px;
overflow: hidden;
white-space: nowrap;
animation: marquee 7s linear infinite;
webkit-animation: marquee 7s linear infinite;
}

@keyframes rotate {
from {transform: rotateY(0deg);}
to {transform: rotateY(360deg);}
}

@-o-keyframes rotate {
from {transform: rotateY(0deg);}
to {transform: rotateY(360deg);}
}

@-moz-keyframes rotate {
from {transform: rotateY(0deg);}
to {transform: rotateY(360deg);}
}

@-webkit-keyframes rotate {
from {transform: rotateY(0deg);}
to {transform: rotateY(360deg);}
}

.number_full {
text-align: center;
animation: rotate 7s linear infinite;
-webkit-animation: rotate 7s linear infinite;
-o-animation: rotate 7s linear infinite;
-moz-animation: rotate 7s linear infinite;
}

.number_full h1 {
text-shadow: 0 0 100px #777;
transform: rotateX(20deg);
padding: 100px;
font-size: 600pt;
}
    <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name=viewport content="width=device-width" , inital-scale=1.0>
<link rel="stylesheet" href="../layouts/style.css">
<script src="../reload.js"></script>
<title>3</title>
</head>
<body>
<div class="number">
<h1>3</h1>
</div>
<div class="names">
Marc
...
</div>
</body>
</html>

关于HTML div 切断其他 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42783480/

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