hover property in CSS doesn't work when I have an inline styles

前端 未结 2 1774
再見小時候
再見小時候 2021-01-26 06:07

I was work on a HTML document and I wanted to use the hover property for a HTML: div element but it didn\'t work. here the HTML div and the CSS style I used

<         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-26 06:51

    Inline style have the highest priority. If you need to override in CSS, need to use !important

    div:hover {background-color: red !important;}
    

提交回复
热议问题