Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的“一页”网站上有一个固定的标题。当您单击菜单项 <a href="#itemone">Item One</a> 时,它会转到该部分。
<a href="#itemone">Item One</a>
Header 的高度为 50px,它覆盖了部分内容。
有没有人有办法解决吗?
http://jsfiddle.net/SUP4d/
尝试添加55px到margin-top(或padding-top) for body,并设置top: 0;为固定标题。
55px
margin-top
padding-top
body
top: 0;
body, html { margin-top: 55px; }