Hover state is maintained during a transition even if the element has gone

前端 未结 6 2089
有刺的猬
有刺的猬 2021-02-20 01:52

Consider a simple element, and its associated CSS:

Hover me !


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 02:31

    This behavior is normal and can not be changed. It is correctly implemented according to the specification @Stasik linked to.

    If you have to change this behavior, you could use javascript with jquery instead of css pseudo classes. I created a jsfiddle to demonstrate a possible approach using the .ismouseover() jQuery extension by @Ivan Castellanos provided here.

提交回复
热议问题