位置:固定资产净值不会保持固定 [英] Position: fixed nav does not stay fixed
问题描述
我正在开发的网站遇到很多问题.甚至下载到缓慢的页面加载等.但是我遇到的最大问题是固定位置元素的行为.
I have been having a tonne of issues with a site I'm developing. Even download to slow page loads and such. But the biggest issue I'm having is the behaviour of fixed position elements.
首先,导航应该始终保持固定,但事实并非如此.但是,如果在滚动时重新加载,它确实会出现在页面中间.很奇怪.
First of all the nav is supposed to stay fixed at all times, but it doens't. It does however appear in the middle of the page if you reload whilst you are scrolled. Very odd.
所有背景中的第二个应该保持固定,但不能固定.
Second of all the background is supposed to stay fixed yet it does not.
导航代码
<div class="navwrapper">
<nav id="top">
<div class="wrapper">
<ul>
<li><a href="#project" class="scroll">The Project</a></li>
<li><a href="#makers" class="scroll">The Makers</a></li>
<li><a href="#markets" class="scroll">The Markets</a></li>
<li><a href="#workshops" class="scroll">The Workshops</a></li>
<li><a href="#shop" class="scroll">The Shop</a></li>
<li><a href="#getinvolved" class="scroll">Get involved</a></li>
</ul>
</div></nav>
<span class="navshadow"></span>
</div>
CSS
.navwrapper{position:fixed;width: 100%;top: 0;}
推荐答案
Chrome浏览器中有一个错误,该错误已固定位置并进行了转换:
There is a bug in Chrome with position fixed and transforms:
https://code.google.com/p/chromium /issues/detail?id = 20574
因此,您将必须从.label
中删除转换.
So you will have to remove the transforms from .label
.
另请参阅:
这篇关于位置:固定资产净值不会保持固定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!