我有一个基于角度框架的当前网站,我正在尝试创建一个css下拉菜单。在CHrome和IE上看起来都很完美但我在Firefox上测试时遇到了障碍。我已经搜索了几个答案,但我尝试过没有修复Firefox上的这个小错误。基本上将鼠标悬停在按钮上会出现css菜单,当我尝试移动鼠标时,只要我的光标离开用于激活菜单的按钮边界,菜单就会消失。
以下是JS Fiddle的一个小例子:https://jsfiddle.net/4yzap1mt/3/
.small-screen-menu {
display: none;
position: absolute;
left: 0px;
top: 10px;
background-color: #f9f9f9;
min-width: 270px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 99998;
}
.small-screen-menu-item h4 {
text-align: left;
padding-left: 6px;
padding-top: 6px;
}
.small-screen-menu-item ul {
text-align: left;
padding-left: 0px;
}
.small-screen-menu-item ul li {
list-style-type: none;
padding-left: 6px;
font-size: 14px;
}
.small-screen-menu a {
color: black;
padding: 6px;
text-decoration: none;
display: block;
text-align: left;
}
.small-screen-menu-logout a {
text-align: center;
border-top: 1px solid #000;
}
.small-screen-menu a:hover {
background-color: #f1f1f1;
}
.navbar-header button {
z-index: 99999;
}
.navbar-toggle:hover + .small-screen-menu {
display: block;
}
.small-screen-menu:hover {
display: block;
}
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed">
<span class="sr-only">Toggle navigation</span>
</button>
<div class="small-screen-menu">
<div class="small-screen-menu-item">
<h4>Section 1</h4>
<ul>
<li><a>item 1</a>
</li>
<li><a>item 2</a>
</li>
</ul>
</div>
<div class="small-screen-menu-item">
<h4>Section 2</h4>
<ul>
<li><a>item 1</a>
</li>
<li><a>item 2</a>
</li>
</ul>
</div>
<div class="small-screen-menu-item">
<h4>Section 3</h4>
<ul>
<li><a>item 1</a>
</li>
<li><a>item 2</a>
</li>
</ul>
</div>
</div>
</div>
随意尝试使用chrome和firefox。非常感谢修复或替代解决方案。我想尝试找到一个修复,而不会破坏现有代码。