开发者

Pseudo classes in CSS

<a cl开发者_Go百科ass="success" href="javascript:void(0)"></a>

//CSS for setting background for above link
a.success:hover{
//set background image
}

My intent is to change the class of the link on server side based on success/fail and set icon for the link accordingly. But the above CSS is not working as expected.


There is nothing wrong with that css.

However, your link is empty so it will not take up any space meaning that a background image will not be shown.

You will need to put something in the a tag or make it a block level element in order for the element (and the background...) to show.

By the way, I am just assuming that you are not really using the // to comment in your style-sheet as that is not valid. Use /* */ if you want to comment in a style-sheet.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜