简体   繁体   English

将元素绝对定位在固定位置的div IE中不起作用

[英]Absolute positioning an element inside a fixed positioned div IE not working

OK, this is driving me crazy now, I already messed with all my code and still can't get this to work. 好的,这现在使我发疯,我已经弄乱了我的所有代码,但仍然无法正常工作。

I am developing a WP theme and for it I am offering users the possibility to choose between a fixed header or a fluid one. 我正在开发WP主题,为此我为用户提供了在固定标头或可变标头之间进行选择的可能性。

The problem comes when the user selects the fixed one under IE where the dropdown menu is not showing at all. 当用户在下拉菜单根本不显示的IE下选择固定选项时,就会出现问题。

I created an example site here: http://makanudos.com/tests/ for anyone who may be willing to help me. 我在这里创建了一个示例网站: http : //makanudos.com/tests/,以供任何可能愿意帮助我的人。

Thanks a lot in advance! 在此先多谢!

Wow, took me a while to find this one… and it's a bug in IE8. 哇,花了我一段时间才找到这个……这是IE8中的一个错误。

#menuConquistador { filter: alpha(opacity=96); }

is breaking the display in IE8. 正在破坏IE8中的显示。 Disabling it makes the menu appear as expected. 禁用它会使菜单按预期显示。

I thought it would be as simple as setting it differently as this article suggests , however, even using the correct IE8 -ms-filter extension causes the sub-menu to hide under the rest of the page. 我认为这将像本文建议的那样简单地进行不同的设置,但是,即使使用正确的IE8 -ms-filter扩展名,该子菜单也会隐藏在页面的其余部分下。

Edit: You might find some workarounds here if you really need a 96% opaque menu :-) Personally, I'd just remove the filter for IE7/8. 编辑:如果您确实需要96%的不透明菜单,则可能会在这里找到一些解决方法:-)就个人而言,我只是删除IE7 / 8的过滤器。 Users with decent browsers can get the nice transparent effect. 浏览器不错的用户可以获得很好的透明效果。

Also, just found Internet Explorer CSS property "filter" ignores overflow:visible 另外,刚刚发现Internet Explorer CSS属性“过滤器”会忽略溢出:可见

Edit 2: OK, so adding 编辑2:确定,所以添加

#menuConquistador { -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity=50)'; }

and removing the z-index:10000 (there seems to be two for the #menuConquistador selector) allows the menu appear in IE8 and have opacity! 删除z-index:10000#menuConquistador选择器似乎有两个)可以使菜单出现在IE8中并且不透明!

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

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