容器宽度位置:固定跳转到左侧

时间:2016-01-27 21:01:21

标签: css twitter-bootstrap-3 affix

如果它是Bootstrap Affix问题,或者只是一个很小的CSS错误,我试着想一想。

当导航开始在顶部修复时,它跳到左边,我不知道为什么会发生这种情况。

链接:http://new.myshirtstore.de

1 个答案:

答案 0 :(得分:0)

这很容易搞清楚......

您的ID为#topmenu且此元素的widthInherit您需要做的就是为此width 100%width: Inherit

#topmenu { width: 100%; top: 0; margin-bottom: 15px; z-index: 100; border: 0; background: #ebedef; border: 0; border-bottom: 3px solid #95bf0c; } 从其父元素继承属性,导致导航栏跳转到左侧!

http://www.w3schools.com/cssref/pr_dim_width.asp

你的新#topmenu应该是这样的:

{{1}}