开发者

Problem changing background color of tr in firefox using CSS

I have a table with rows which have alternating classes, I am trying to highlight the row hovered on using css.

Here is the CSS I use:

.gridrowclass1 {
    background-color : #bbb00b
}

.gridrowclass1:hover {
    background-color: bisque;
}

.gridrowclass2 {  
    background-color: #d18915;
}

.gridrowclass2:hover {
    background-color: bisque;
}

This works fine on chrome, but does not on Firefox 3.6.18. My question is am I doing something wrong here or this is a problem with the Firefox version I use and if this would work on newer versions. I currently cannot try this out on any开发者_开发知识库 other browser. Googling did not reveal anything that I missed. If this does not work, I would have to fall back on onMouse* events but I do not want to do that.


i had the same issue some time ago. I came around by using:

.gridrowclass1 {
    background-color : #bbb00b
}

.gridrowclass1 td:hover {
    background-color: bisque;
}

.gridrowclass2 {  
    background-color: #d18915;
}

.gridrowclass2 td:hover {
    background-color: bisque;
}

it seems that firefox does not recognize hover of a tr if the mouse is over a td element


Check whether the missing semi-colon after the first color value is a problem. I think that it is the problem - try adding that semicolon - it should work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜