css - 覆盖垂直滚动条的粘性标题

标签 css html header

我的粘性标题覆盖了垂直滚动条,有没有办法解决这个问题?

网址:http://jlwebdesigns.co.uk/

标题代码(使用 HTML5 标签)

header {
    background: none repeat scroll 0 0 #283744;
    border-bottom: 4px solid #4F5B66;
    height: 97px;
    margin-top: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
}

最佳答案

是的,让该元素具有更高的 z-index,并确保您为该元素设置了定位,例如相对或其他定位。

header {
    background: none repeat scroll 0 0 #283744;
    border-bottom: 4px solid #4F5B66;
    height: 97px;
    margin-top: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
}

底层元素

#underlyingelementwithscrolls{
position:relative;
z-index:1000;/*higher than 999 since header has it*/
}

在你的情况下,你已经覆盖了 body 滚动条 这样做它应该得到修复

body{
overflow:hidden;}
html{
overflow-y:scroll;}

关于css - 覆盖垂直滚动条的粘性标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21231820/

相关文章:

css - 雅虎邮件用最小宽度替换内联宽度

javascript - jQuery 触发鼠标移出事件

html - 防止自定义(损坏的)html 损坏页面的其余部分

wpf - 将图标放在 WPF 扩展器控件的右端

java - 请求中缺少 token

javascript - 尝试仅在文本之前禁止 <p> 标签

html - 如何在 td 元素中呈现文本和按钮元素而不换行?

html - 单选按钮显示在标签中间

jquery - 将页面滚动到滚动 jquery 上的 div

PHP如何在标题重定向到另一个页面之前回显警报