导航栏突然在顶部而不是底部HTML
问题描述:
我的导航栏很好并固定在底部,直到我在html中添加了谷歌字体API和其他字体选项的链接。我评论了我改变的一切,然后我删除了它,但没有任何工作。导航应该完全保持原样,就在底部。 这里是我的html:导航栏突然在顶部而不是底部HTML
<div class="navbar">
<nav>
<a href="otherpage.html">Blog</a>
<a href="otherpage.html">Linguistics Facts</a>
<a href="otherpage.html">More About Me</a>
</nav>
</div>
</body>
</html>
这里是我的CSS:
.navbar {
position: relative;
bottom: 0;
width: 100%;
list-style: none;
}
.navbar a {
float: center;
display: block;
text-align: center;
padding: 10px 12px;
margin: 15px; /*experimental*/
background-color: #f7b733;
color: white;
font-family: 'PassionTea', 'Amatic SC';
font-size: 170%;
list-style-type: none;
}
答
.navbar{
position:fixed;
bottom:0;
width:100%;
height: desired height;
}
要坚持你的菜单,视口的你需要设置固定不relative.You不要”位置的底部需要列表式:无;因为你在导航标签上没有任何列表。
您面临什么问题?你能发表问题的图片吗? – Nimish
nav应该在什么底部? 'float:center'无效btw –
是的,我超越了自己,试图使用我并不完全了解的财产。它应该在页面的底部,但我摆脱了浮动属性,并将位置改为绝对,并且这解决了问题。老实说,我不知道我以前是如何做到的。谢谢! –