css鼠标停留背景变色

来源:百度知道 编辑:UC知道 时间:2024/06/16 12:56:48
http://service.sony.com.cn/NewsandNotice.htm

左边导航:个人电脑/数码影像。。那块。怎么实现的鼠标停留变换不同的颜色呢?

针对不同的<a></a>定义不同的样式就可以了

<!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=gb2312" />
<title>无标题文档</title>
<style type="text/css">
a {
width: 100px;
height: 20px;
display:block;
background-color:#999999;
}
a.link1:hover {
background-color:#FF0000;
}
a.link2:hover {
background-color:#00FF00;
}
</style>
</head>

<body>
<a href="#" class=&