css中如何定义鼠标经过改变图片,并且可以有链接点击
不用那么麻烦,活用a标签就可以了
<style type="text/css">
a.home {background:url(鼠标滑过之前的图片地址) no-repeat; width:100px; height:20px; display:inline-block;_float:left;}
a.home:hover {background:url(鼠标滑过的图片地址) no-repeat;
</style>
<div>
<a href="http://www.baidu.com" class="home">首页</a>
</div>
这样就可以实现有链接的可以换图的效果
上一篇:css字体倾斜和斜体有什么不一样
热门标签: