gpt4 book ai didi

css - 无法适应网站作为屏幕的分辨率

转载 作者:太空宇宙 更新时间:2023-11-04 10:20:11 25 4
gpt4 key购买 nike

我无法使网站适合用户的屏幕,它就是不接受更改,我尝试了几种方法但找不到问题所在。

CSS。

<style>
.full-width-div {
position: absolute;
width: 100%;
height: 100%;
left: 0;
}

#texto {
width: 100%;
height: 51px;
color: white;
text-align: center;
}

p.uno {
text-align: center max-width: 90%;
max-height: 90%;
color: yellow;
text-shadow: 4px 2px 0px #000000;
}

a {
color: yellow;
}

a {
text-align: center;
}

a {
text-decoration: none;
}

a.wsnextlink1:link {
text-decoration: none;
color: #2a5db0;
}

a.wsnextlink1:visited {
text-decoration: none;
color: #560080;
}

a.wsnextlink1:hover {
text-decoration: underline;
color: #800000;
}

div.shadow {
padding-top: 5px;
text-align: center;
max-width: 90%;
max-height: 90%;
overflow: visible;
}

img.logo {
padding-top: 5px;
max-width: 90%;
max-height: 90%;
border-radius: 5%;
}

video#bgvideo {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
transform: translate(-50%, -50%);
}
</style>

HTML:这是网站不适合屏幕且看起来很奇怪的问题。

<body>
<div class="full-width-div">
<div class="shadow">
<div id="texto">
<p class="uno" style="font-weight:normal;color:white;letter-spacing:1pt;word-spacing:2pt;font-size:35px;text-align:center;font-family:helvetica, sans-serif;line-height:1;">

text.</p>
</div>

<img src="017.jpg" class="logo">
<div id="texto">
<p class="uno" style="font-weight:normal;color:white;letter-spacing:1pt;word-spacing:2pt;font-size:35px;text-align:center;font-family:helvetica, sans-serif;line-height:1;">
<a href="finish.html" align="center">

</a>
</p>
</div>
<div id="texto">
<p class="uno" style="font-weight:normal;color:white;letter-spacing:1pt;word-spacing:2pt;font-size:35px;text-align:center;font-family:helvetica, sans-serif;line-height:1;">
<a href="017.html" align="center">


</a>
</p>
</div>

最佳答案

尝试使用下面的,看起来你的 div 标签没有全部关闭,你可能需要看看我这里的 div 标签,它们可能需要根据您的需要进行修改,但我认为这应该可以适当缩放并防止滑动:

<html>
<head>
<style>
.full-width-div {
position: absolute;
width: 100%;
height: 100%;
left: 0;
}
#texto {
width:100%;
height:51px;
color:white;
text-align:center;
}

p.uno {
text-align:center
max-width:90%;
max-height:90%;
color: yellow;
text-shadow: 4px 2px 0px #000000;
font-weight:normal;
color:white;
letter-spacing:1pt;
word-spacing:2pt;
font-size:35px;
text-align:center;
font-family:helvetica, sans-serif;
line-height:1;
}

a{color: yellow;}
a{text-align:center;}
a {text-decoration: none;}
a.wsnextlink1:link{text-decoration:none; color:#2a5db0;}
a.wsnextlink1:visited{text-decoration:none; color:#560080;}
a.wsnextlink1:hover{text-decoration:underline; color:#800000;}


div.shadow {
padding-top: 5px;
text-align: center;
max-width:90%;
max-height:90%;
overflow:visible;
}

img.logo {
padding-top: 5px;
max-width:90%;
max-height:90%;
border-radius: 5%;
}

video#bgvideo {

position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<div class="full-width-div">
<div>
<div class="shadow">
<div id="texto"><p class="uno">text.</p></div>
<div><img src="017.jpg" class="logo"></div>
<div id="texto"><p class="uno"><a href="finish.html" align="center">link1</a></p></div>
<div id="texto"><p class="uno"><a href="017.html" align="center">link2</a></p></div>
</div>
</div>
<div>
<video id="bgvideo" autoplay loop>
<source src="club08.mp4" type="video/mp4">
<source src="movie.ogg" type="video/webm">
Your browser does not support the video tag.
</video>
</div>
</div>
</body>
</html>

编辑:我在 video 周围添加了一个 div 以确保它也呈现为 block 元素。我认为它有时可以呈现为 block 或内联。

关于css - 无法适应网站作为屏幕的分辨率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36900157/

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