利用JavaScript实现鼠标经过图像是理所当然,但这个小特效其实也可以用CSS实现!
====================================================
<html>
<head>
<title>利用CSS实现鼠标经过图像</title>
<style>
a {
display:block;
width:150px;height:25px;
background:url(t1.gif) no-repeat center;
}
a:hover {
display:block;
width:150px;height:25px;
background:url(t2.GIF) no-repeat center;
}
</style>
</head>
<body>
<a href="#"></a>
</body>
====================================================
间接的使用CSS中标签<a>的伪选择器来改变其背景图!!!
能够达到使用JS实现的鼠标经过图像的相仿效果!!!