tes*_*ius 11 fixed navbar twitter-bootstrap
我有一个关于navbar-fixed-top的问题.好吧,我有一个简单的问题.我的固定导航栏涵盖了内容,例如在"关于我们"页面中,它涵盖了"关于我们"标题的行.
我不知道如何解决它,因为当我调整网站大小(移动设备大小)时,标题是可见的.
当然我在其他页面(Full Width和404)中有标题这种问题.
此外,在索引页面中,它涵盖了一些轮播滑块.
信息:
bootstrap 2.3.2
请告诉我,如何在所有决议中修复它.
che*_*npi 12
响应在页面中:
添加到您的CSS:
body {
padding-top: 65px;
}
Run Code Online (Sandbox Code Playgroud)
或更复杂的解决方案,但响应,如果您的导航栏更改高度(平板电脑中的ex出现在更多到60px;或不同)使用css和javascript的混合解决方案
CSS:
#godown{
height: 60px;
}
Run Code Online (Sandbox Code Playgroud)
HTML(resumen)
<body>
<nav class="navbar navbar-fixed-top " role="navigation" id="navMenu">
...
</nav>
<!-- This div make the magic :) -->
<div class="godown-60" id="godown"></div>
<!-- the rest of your site -->
...
Run Code Online (Sandbox Code Playgroud)
JAVASCRIPT:
<script>
//insert this in your jquery
//control the resizing of menu and go down the content in the correct position
$("#navMenu").resize(function () {
$('#godown').height($("#navMenu").height() + 10);
});
if ($("#navMenu").height() > $('#godown').height()) $('#godown').height($("#navMenu").height() + 10);
</script>
Run Code Online (Sandbox Code Playgroud)
小智 8
position: sticky
而不是position: static
为我做了这件事。