<!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>Dialog</title>
<style type="text/css">
a div{ width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18293/18293437.jpg)}
a:visited{  width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18293/18293437.jpg)}
a:hover div{ width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18285/18285748.jpg)}
</style>
</head>
<body >
<a href='javascript:void(0);'><div class="c"></div></a>
</body>
</html>我希望后面不是根据div来判断的是
是根据样式判断  比如说上面的样式c
这个该怎么克修改

解决方案 »

  1.   

    this?
    a:hover .c{ width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18285/18285748.jpg)}
      

  2.   


    <!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><!-- http://topic.csdn.net/u/20090611/10/6e4f25af-31a6-4d91-8d04-2d4160dcb8bc.html?37209 -->
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>Dialog</title>
    <style type="text/css">
    .c{ display:block;width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18293/18293437.jpg)}
    a:visited{  width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18293/18293437.jpg)}
    a:hover .c{ width:90px; height:60px; background-image:url(http://img1.gtimg.com/news/pics/18285/18285748.jpg)}</style>
    </head>
    <body >
    <a href='javascript:void(0);'><div class="c"></div></a>
    <br>
    <a href='javascript:void(0);'><span class="c"></span></a>
    </body>
    </html>