with an inner not triggering :active state in IE 8

后端 未结 8 540
太阳男子
太阳男子 2020-12-03 15:48

I want to style the :active state of a button that is represented by an tag. The tag has an inner

8条回答
  •  执念已碎
    2020-12-03 16:25

    Right, terribly over-complicated solution (and still imperfect), but: if you don’t wrap the link text in the , and instead just use the as a place to put your background image and position it absolutely within the , then the (mostly) stops blocking the :active state.

    Test page: http://www.pauldwaite.co.uk/test-pages/2769392/3/

    HTML

    
    Link
    
    

    CSS

    
    

    Of course, the area that the covers still traps the click event, so when the user clicks on there, they won’t see the :active state. It is a slight improvement on the previous situation.

提交回复
热议问题