Attribute matchers in CSS don't work with IE11

◇◆丶佛笑我妖孽 提交于 2019-12-24 15:16:08

问题


We noticed on our website that the CSS was broken with IE11, while it worked fine with IE10. After a look at the CSS source, it turns out that IE11 (it seems) has dropped its support for attributes matchers: we tried on our VM, we tried on BrowserStack, and the result is that these rules...

img[src$='separator.png'] { display: none; }
a[href="javascript:addBookemart()"] { text-decoration: none; }

... do work on IE10, but not anymore on IE11. I find it hard to believe that the support for this feature would've been dropped... plus, I can't find anyone talking about such a thing over the interwebs. Might there be anything else causing this issue?

Here's a pen for testing purposes:

http://codepen.io/anon/pen/GJNyJW


回答1:


In my experience, IE11 is picky about [attr="value"] having double quotes around the value.




回答2:


I found I was having this issue and it turned out that IE11 was case sensitive with the attribute values.



来源:https://stackoverflow.com/questions/30464405/attribute-matchers-in-css-dont-work-with-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!