我正在努力定位我的菜单,以便它始终在不同尺寸的显示器上保持相同的位置,但是当窗口减小并且尺寸增加时也会响应。我无论如何都没有CSS专家,也没有接受过培训,所以我知道我的代码很差。我也在尝试逐渐简化菜单,但不确定在哪里输入此代码。非常感谢任何帮助。
.HomeBottomMenu {
-webkit-font-smoothing:antialiased;
text-align: center;
text-align: justify;
position: absolute;
bottom: -3em;
}
.HomeBottomMenu ul {
list-style-type: none;
margin: 0;
padding: 0
}
.HomeBottomMenu ul li{
position: relative;
line-height: 21px;
min-width: 220px;
text-align: center;
background: #424242;
}
.HomeBottomMenu ul li a{
display: block;
padding: 8px 8px;
color: #fff;
text-decoration:none;
text-align: left;
font-family: 'BebasNeueRegular', Arial, sans-serif;
font-size: 18px;
font-weight: bold;
}
.HomeBottomMenu ul li a:hover{
color: #fff;
background: #25a0da;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.HomeBottomMenu ul li ul.dropdown{
background: #f2f2f2;
display: none;
position: absolute;
z-index: 999;
left: -0.01em;
}
.HomeBottomMenu ul li:hover ul.dropdown{
display: inline;
bottom: 100%;
position: absolute;
background: #939393;
min-height: 50px;
}
.HomeBottomMenu ul li ul.dropdowndropdown {
position: relative;
overflow:hidden;
z-index: 100;
height:0;
transition-property: height;
transition-duration: 0.5s;
transition-timing-function: linear;
transition-delay: 0.5s;
Opacity:1;
}
.HomeBottomMenu ul li ul :hover .dropdowndropdown{
position: relative;
display:inline;
bottom:100%;
height: 200px;
Opacity:1;
}
.HomeBottomMenu ul li ul.dropdowndropdown li{
display: block;
background-color: rgba(0, 90, 235, 0.33);
bottom: 100%;
}
.HomeBottomMenu ul li ul.dropdowndropdown li:hover{
position: relative;
}
.HomeBottomMenu ul li ul.dropdowndropdown li a{
color:#fff;
font-size:16px;
padding: 10px 10px;
text-align:center;
}
.HomeBottomMenu ul li ul .dropdowndropdown li a :hover{
color: #fff;
}
答案 0 :(得分:0)
使用它:
<script type="text/javascript"> $(window).scroll(function() { if ($(this).scrollTop() > 90) { $('.HomeBottomMenu').fadeOut(100); } else { $('.HomeBottomMenu').fadeIn(); } }); </script>
非常感谢你的帮助。