IE10 Hover + Pseudo Elements

风流意气都作罢 提交于 2019-12-23 16:59:55

问题


Example: http://codepen.io/mastastealth/pen/gFjhi

Basically, I have an element with an :after element set to opacity 0. On hover, it goes to opacity 1. Apparently it works in IE9 and everywhere else, but not IE10 (unless I click)? Ideas?


回答1:


It appears there is a bug where the selector with a pseudo class followed by a pseudo element is not listened for when an event happens. If you add the listener by simply adding the selector with only the pseudo class your style will be applied on the event occurring.

http://codepen.io/justinphillips/pen/qvHyi

.p:hover:after {
    opacity: 0.7;
  } 

.p:hover {}



回答2:


Apparently IE10 continues the horrible bug of not accepting :hover on divs. Example updated using an element instead and it works fine.



来源:https://stackoverflow.com/questions/14114526/ie10-hover-pseudo-elements

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