javascript - 在所有其他内容上导航以及与导航一起响应内容?

标签 javascript html css

我正在做一个元素,我有一个响应式导航,尽管导航似乎一切正常。但是当涉及到内容时,内容并没有跟随它应该在的位置,而是在导航下方。我不确定如何解决这个问题,但无论如何,要在这里查看我的代码:http://jsfiddle.net/MsDLC/并查看结果:http://fiddle.jshell.net/MsDLC/show/

页面中的内容在div“页面”中,只有css:

.page{
    margin-top: -400px;
    max-width: 78.667em;
    margin-left: auto;
    margin-right: auto;
}

最佳答案

您可以将下面的代码添加到 #menu 使导航遍历文本

#menu {    
    z-index: 99;
    position: relative;
}

更新以回答对齐问题(快速修复)

.page {
    max-width: 82.667em; /* this becomes a fixed number */
    width: 100%;
    padding: 0 2em; /* spacing for the sides */
}

关于javascript - 在所有其他内容上导航以及与导航一起响应内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17938657/

相关文章:

javascript - jQuery 伪选择器 ":not"IE7 不工作?

jquery - 使用Bootstrap和jQuery,如何让容器类在侧边栏激活时更改为较小的尺寸?

javascript - jQuery.cookie : no update of the cookie despite a very simple code

html - 在 CSS 中设计圆 Angular 矩形

javascript - 如何从 HTML 视频元素获取视频的渲染大小

html - 使用自闭 DIV 标签可以吗?

javascript - 如何找到我点击页面的任何内容的相对xpath(Javascript)

javascript - Angularjs View 中的 ng-repeat 与 Controller 中的 for 循环

javascript - 在包括固定背景的整个页面上使用 CSS 转换(在 Firefox 中)

html - 列图像充当背景图像