繁体   English   中英

视差滚动文本在第一个滚动上跳到顶部

[英]Parallax scroll text jumps on top on first scroll

如果属性为position:fixed; top:500px or 40% ,,则文本将在第一次滚动时跳到顶部position:fixed; top:500px or 40% position:fixed; top:500px or 40%可见,直到该属性为margin-top:500px;时才滚动margin-top:500px;

链接到该站点: http : //www.pappu-lighting.com/Series/Kutiq/LAST.html (单词GEOMETRY)

它的代码:

#seriq {
color:white;
z-index:9999;
position:absolute;
font-family:futuraat;
font-size:5vw;  
padding:0px;
top:70%;
width:100%;
text-align:center;
}

我想让它从一开始就可见,而不是一头雾水。

您可以使用position:sticky; 使元素在滚动时保持特定位置并在整个过程中可见

https://developer.mozilla.org/en/docs/Web/CSS/position

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM