CSS实现鼠标移动到图片,更换图片
2014-04-01 20:31:34   来源:   评论:0 点击:

<!DOCTYPE html PUBLIC "- W3C DTD XHTML 1 0 Transitional EN" "http: www w3 org TR xhtml1 DTD xhtml1-transitional dtd"><h
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS实现鼠标移动到图片,更换图片</title>
</head>
<style type="text/css">
*{ margin:0; padding:0;}
ul li{ list-style:none;}
.nav{ width:800px; height:40px; margin:150px auto;}
.nav ul li{ float:left; width:200px;}
.nav ul li a:link,a:visited{ display:block; width:190px; height:40px; background:url(http://www.codefans.net/jscss/demoimg/wall_s1.jpg);}/*链接、点击后*/
.nav ul li a:hover{background:url(http://www.codefans.net/jscss/demoimg/wall_s2.jpg);}/*鼠标经过*/
.nav ul li a:active{background:url(http://www.codefans.net/jscss/demoimg/wall_s3.jpg);}/*点击时*/
</style>
<body>
<div class="nav">
<ul>
    <li><a href="#">sffsafdasfasfasf</a></li>
        <li><a href="#"></a></li>
        <li><a href="#"></a></li>
    </ul>
</div>
</body>
</html>

相关热词搜索:

上一篇:打开网页1秒之后弹出屏幕居中的浮动层
下一篇:html中视频播放器的代码示例

相关推荐