简体   繁体   English

Twitter引导程序按钮下拉列表在IE9中无效

[英]Twitter Bootstrap button dropdown not working in IE9

UPDATE: Ok, I found the cause. 更新:好的,我找到了原因。 The grey area where the button resides is a div for the navigation. 按钮所在的灰色区域是导航的div。 It has fixed position and a high z-index to make it float above other elements. 它具有固定位置和高z指数,使其浮动在其他元素之上。 This is what's causing the problem. 这就是导致问题的原因。 If I remove the z-index of the parent DIV, it works fine. 如果我删除父DIV的z-index,它可以正常工作。 But I can't do that because the other elements will then overlap the fixed navigation div. 但我不能这样做,因为其他元素将与固定导航div重叠。

How it's Supposed to Look like (FIREFOX) 如何看起来像(FIREFOX)

如何看起来像(FIREFOX)

How it is rendered in IE (9) 如何在IE中呈现(9)

如何在IE中呈现(9)

Full Code: 完整代码:

<div class="btn-group pull-right">
    <a class="btn btn-primary btn-large dropdown-toggle" style="font-weight: bold; margin-top:15px" data-toggle="dropdown">
    Hi @User.Identity.Name!
    <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
        <li><a href="@Url.Action("Index","Lab")">Open the Lab</a></li>
        <li class="divider"></li>
        <li><a href="/Account/LogOff">Log-out</a></li>
    </ul>
</div>

Anyone got any ideas or workarounds/overrides I need to put in the CSS to cover this problem? 任何人有任何想法或变通办法/覆盖我需要在CSS中填写这个问题?

.dropdown-menu{
z-index:99;
}

Should do the trick...Though depending on the version of IE there are some caveats. 应该做的诀窍......虽然取决于IE的版本,但有一些警告。

I had the same issue with bootstrap 3. Removing the filter property from the .navbar class worked for me. 我在bootstrap 3中遇到了同样的问题。从.navbar类中删除filter属性对我有用。

.navbar {
  /*filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);*/
}

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

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