css中如何定义鼠标经过改变图片

如题所述

从原理说起吧:激活的、已访问的、未访问的或者当有鼠标悬停在其上的链接,它们会在支持 CSS 的浏览器中以不同的方式显示出来,样式如下:
1. a:link {background:url(images/bg1.jpg) no-repeat 0 0;} /* 未访问的链接 */
2. a:visited {background:url(images/bg1.jpg) no-repeat 0 0;} /* 已访问的链接 */
3. a:hover {background:url(images/bg1.jpg) no-repeat 0 0;} /* 当有鼠标悬停在链接上 */
4. a:active {background:url(images/bg1.jpg) no-repeat 0 0;} /* 被选择的链接 */
在其中设置你想要的背景图片吧,如果是4个不同的图片,你就会看到4种不同状态下的效果。
温馨提示:内容为网友见解,仅供参考
第1个回答  2011-11-04
a:hover{
background-image:
}
相似回答