在这个引导主题中,当你向下滚动并在我的JsFiddle中时,导航栏更改大小我尝试重新创建,但出于多次尝试失败和放弃。我在一旁看着的堆栈溢出问题和其他的网页很多,也许我的关键字是错误或东西,但我没有找到我要找的linkss低于Navbar在页面顶部改变大小
,因为这个网站想要一些代码生病后,但如果你们会发布的jsfiddle链接,我会perfer ..
CSS
body {
padding: 0;
/* Gets rid of the automatic padding */
margin: 0;
/* on HTML documents */
font-family: Lucida Grande, Helvetica, Arial, sans-serif;
font-size: 12px;
}
#navigation {
position: fixed;
top: 0;
width: 100%;
color: #ffffff;
height: 35px;
text-align: center;
padding-top: 15px;
/* Adds shadow to the bottom of the bar */
-webkit-box-shadow: 0px 0px 8px 0px #000000;
-moz-box-shadow: 0px 0px 8px 0px #000000;
box-shadow: 0px 0px 8px 0px #000000;
/* Adds the transparent background */
background-color: rgba(1, 1, 1, 0.8);
color: rgba(1, 1, 1, 0.8);
}
#navigation a {
font-size: 14px;
padding-left: 15px;
padding-right: 15px;
color: white;
text-decoration: none;
}
#navigation a:hover {
color: grey;
}
/* This just adds some style to the placeholder text */
#content {
width: 600px;
padding-top: 70px;
padding-bottom: 30px;
margin-left: auto;
margin-right: auto;
{
HTML
<div id="navigation">
<a href="#">Home</a>
<a href="#">Portfolio</a>
<a href="#">Our Apps</a>
<a href="#">Support</a>
<a href="#">Press</a>
<a href="#">About</a>
</div>
这里有另一种方法:http://stackoverflow.com/questions/6713324/how-to-shrink-navigation-menu-when-scrolling-down – toast
非常感谢这是我在找什么:) – user3079663