【问题标题】:Parallax scroll fixed header视差滚动固定标题
【发布时间】:2015-09-26 20:43:36
【问题描述】:

我的视差滚动网站有问题。我需要在网站顶部创建一个固定的标题,但它不会保持“固定”。

此处为完整代码的链接: http://jsfiddle.net/ressy0101/sx4ukc1c/5/

#header{
 position: fixed;
 background-color: black;
 height: 50px;
 width: 100%;
 z-index: 9999;
 color:white;
 text-align:center;
 font-size:40px;
}

【问题讨论】:

标签: scroll header css-position parallax


【解决方案1】:

这对我有用,希望它能解决您的问题。

更改position:sticky;

并添加

top:0px;

#header{
     top:0px;
     position:sticky;
}

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2016-09-16
  • 2012-11-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-27
相关资源
最近更新 更多