标题不粘在屏幕顶部

问题描述 投票:0回答:1

我正在该网站上使用移动电话:hannelorefischer.com

但是,标题没有粘在屏幕顶部。这是我的代码:

<div class="show" style="position: -webkit-sticky; position: sticky;  top: 0; display:none; margin-top: 250px; text-align: center; font: Italic 18px/29px 'pensumpro-book'; letter-spacing: 0px; color: #000000; opacity: 1;"><a href="#aktuelles">Aktuelles</a>&nbsp; &nbsp; &nbsp; <a href="#buecher">Bücher</a>&nbsp; &nbsp; &nbsp; <a href="#texte">Texte</a>&nbsp; &nbsp; &nbsp; <a href="#biographie">Biographie</a></div>

我可能在这里错了,但是我相信当容器div关闭时,它会停止工作。

此外,我正在用.load() jquery调用标头部分。

有什么想法吗?

javascript html css sticky
1个回答
0
投票

使用position: fixed;代替position: sticky;

© www.soinside.com 2019 - 2024. All rights reserved.