简体   繁体   English

CSS子菜单定位可在Chrome和Safari中使用,但不适用于IE和Firefox

[英]CSS Sub-menu positioning works in Chrome & Safari, but not IE and Firefox

I'm currently building a site for a gaming community, called http://www.quad-gaming.com/ . 我目前正在为游戏社区建立一个名为http://www.quad-gaming.com/

Everything is running smooth except the dropdown menu under "Login" at the right side of the navigation bar. 除了导航栏右侧“登录”下的下拉菜单外,其他所有内容都运行顺利。 It works well in Chrome and Safari, but in IE and Firefox, it floats to the left. 它在Chrome和Safari中运行良好,但在IE和Firefox中,它浮动在左侧。

What am I doing wrong? 我究竟做错了什么?

Indeed a bit strange. 确实有点奇怪。

If you specify the ul element to have a left value to zero, it works fine: 如果指定了ul有一个元素left值为零,它工作正常:

nav ul li ul {
  left: 0;
}

Can't try it on IE because I am on a Mac. 我在Mac上,因此无法在IE上尝试。 Hope it works also there. 希望它在那里也能工作。

Try this 尝试这个

.dropdown ul {
    left: 0;
}

Tested and works on Win7 on IE10, IE8, FF20 and Chrome 26 经过测试,可在IE10,IE8,FF20和Chrome 26上的Win7上运行

I've used 我用过

nav ul li ul {
    position:absolute;
    left:0px; /* Adding this to fix left position*/
    visibility: hidden;
}    

And It works in Firefox. 而且它可以在Firefox中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM