Why does the hover pseudo-class override the active pseudo-class

后端 未结 7 1415
不思量自难忘°
不思量自难忘° 2020-12-30 01:17

The title basically says it all.

Suppose I have an element which I want to change color on :hover, but while clicked, I want it to swit

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 02:04

    Because in the first code you defined :hover after you defined :active, so :hover "overwrote" :active. In the second, it's the other way around, :active overwrites :hover.

提交回复
热议问题