gpt4 book ai didi

HTML - 页面在随机滚动点打开

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


我创建了一个网页,发现了一个奇怪的问题。当我尝试从主页转到子页面时,子页面出现了,但向下滚动。它可能出现在顶部,并且它在计算机上 - 但不会手机上。
有一个代码:

HTML(来自正文部分):

<div id="top"><a href="some_link">Go to main</a></div>
<div id="title" class="slide">
<div class="content">
<div class="space">
<span class="centerer"></span>
<span class="centered"><h1>Some centered stuff there</h1></span>
</div>
<div id="changelog_btn">
<a href="#changelog">
<span class="centerer"></span>
<span class="centered">Changelog</span>
</a>
</div>
<div id="dl_btn">
<a href="#download">
<span class="centerer"></span>
<span class="centered">Download</span>
</a>
</div>
<div class="space"></div>
</div>
</div>
<div id="changelog" class="slide">
<div class="content">
<div class="space">
<span class="centerer"></span>
<span class="centered"><h1>Changelog</h1><div class="up_btn"><a href="#top">(Top)</a></div></span>
</div>
<textarea readonly autofocus>
Some changelog stuff
</textarea>
</div>
<div class="space"></div>
</div>
<div id="download">
<div id="content" class="slide">
<div class="space">
<span class="centerer"></span>
<span class="centered"><h1>Download</h1><div class="up_btn"><a href="#top">(Top)</a></div></span>
</div>
Header<br>
<div id="dl_btn">
<a href="file.link" download>
<span class="centerer"></span>
<span class="centered">Download file</span>
</a>
</div>
<div class="space"></div>
</div>
</div>


CSS

@media only screen
and (min-device-width: 240px) {
html {
font-family: 'AtomicAge';
overflow-x: hidden;
background-attachment: fixed;
}
body {
margin: 0;
padding: 0;
background-attachment: fixed;
}
h1 {
margin: auto;
}
.space {
height: 25%;
display: block;
vertical-align: middle;
}
.slide {
width: 100vw;
height: 100vh;
text-align: center;
z-index: -1;
box-shadow: 0 -1px 10px rgba(0, 0, 0, .7);
}

#changelog_btn a, #dl_btn a {
display: inline-block;
vertical-align: top;
width: 20%;
height: 5%;
border: 1px solid;
margin: 15px auto;
}

#changelog_btn a, #dl_btn a {
text-decoration: none;
color: black;
transition: all 0.5s ease;
}
#changelog_btn a:hover, #dl_btn a:hover {
background-color: white;
}
textarea {
width: 80%;
height: 50%;
}
.centered, .centerer {
vertical-align: middle;
display: inline-block;
}
.centerer {
height: 100%;
}
.up_btn a {
text-decoration: none;
color: black;
transition: all 0.5s ease;
}
.up_btn a:hover {
color: white;
}
#title {
background-image: url("_images/bg1.jpg");
background-attachment: fixed;
background-size: cover;
}
#changelog:before, #changelog {
background-image: url("_images/bg2.jpg");
background-attachment: fixed;
background-size: cover;
}
#download {
background-image: url("_images/bg3.jpg");
background-attachment: fixed;
background-size: cover;
}
#top a {
display: inline-block;
width: 100%;
text-align: center;
color: white;
background-color: black;
text-decoration: none;
transition: all 0.5s ease;
}
#top a:hover {
color: black;
background-color: white;
}
}
@media only screen
and (max-width: 1080px) {
* {
margin: 0;
padding: 0;
background-attachment: fixed;
}
}

有什么我可以更正的吗?

最佳答案

您已将自动对焦属性应用于文本区域:)

关于HTML - 页面在随机滚动点打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42375283/

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