Why doesn't CSS hover work on table rows when the cells inside the rows have class names?

前端 未结 6 1936
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 02:13

I am stuck with this problem so any help would be appreciated. I have a table with several rows. Each cell within the row belongs to a certain class. I use these class names to

6条回答
  •  春和景丽
    2021-02-04 02:21

    You probably need to use the !important designator to make sure that your hover style overrides the background defined int he class:

    tr:hover { 
        background-color: #FFFFAF0 !important;
        color: #000 !important; 
    } 
    

    Interestingly, this won't work for IE6 because that browser only applies hover to a tags.

提交回复
热议问题