开发者

Proper CSS syntax multiple classes

开发者 https://www.devze.com 2023-02-01 12:16 出处:网络
This works fine: ul.tabs a.current:hover { background-position: -420px -31px; color:#000; } but this dosent

This works fine:

ul.tabs a.current:hover {
    background-position: -420px -31px;  
    color:#000; 
}   

but this dosent

ul.tabs a.commentArea.current:hover {
     background-position: -420px -31px; 开发者_如何学Go
     color:#000; 
    }

Im getting the indication that I wrote this style incorrectly, as the css isnt working on my element. How would I write this correctly...proper syntax?


It has to be

a.commentArea:hover

selectors targeting the same element must not be separated by spaces.


no space before :hover

ul.tabs a.commentArea:hover


ul.tabs a.commentArea:hover

Remove the space before :hover

See http://www.w3schools.com/CSS/css_pseudo_classes.asp

0

精彩评论

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

关注公众号