[英]Smart Sticky Navigation Menu
I'm having a small problem with some text jumping around in my sticky menu. 我在粘性菜单中跳来跳去出现一些小问题。 This is my code: http://jsfiddle.net/u6ywraj8/ 这是我的代码: http : //jsfiddle.net/u6ywraj8/
As you can see, I want the red #menu
to stick to the top when a user scrolls down. 如您所见,当用户向下滚动时,我希望红色的#menu
在顶部。 However, the text in the top left part of the menu jumps around. 但是,菜单左上方的文本会跳来跳去。 I want this text to always be in the top left part of the red menu, I don't want it to have the initial ~100px padding. 我希望此文本始终位于红色菜单的左上方,我不希望其具有初始的〜100px填充。
Thank you for your help! 谢谢您的帮助!
Add float: left;
添加float: left;
to this class sticknav{}
这堂课sticknav{}
sticknav {
background: #ffffff;
height: 30px;
width: 100%;
margin-right: 0px;
margin-left: 0px;
left: 0px;
right: 0px;
position: relative;
z-index: 9999;
float: left;
}
Try this one 试试这个
sticknav {
background: none repeat scroll 0 0 #ffffff;
display: inline-block;
height: 30px;
left: 0;
margin-left: 0;
margin-right: 0;
position: relative;
right: 0;
width: 100%;
z-index: 9999;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.