日期:2014-05-17  浏览次数:20560 次

请问链接变色(css)的问题
css中定义
a:hover{color:blue;}

html中

<a   href=#> <font   color=red> 123 </font> 456 </a>

这样的话,移动上去,只有456变色,123是红的,
如何做,才能让123也变成我想要的蓝色呢

------解决方案--------------------
<html>
<body>
<style>
a:hover{color:blue;}

a:hover span{color:blue;}

span{color:red;}
</style>

<a href=#> <span> 123 </span> 456 </a>

</body>
</html>
------解决方案--------------------
对不起,上面的说错了!
正确的代码如下!

<style type= "text/css ">
a:link, a:visited, a:active {
color: black;
text-decoration: none;
}
a:hover {
color: blue;
text-decoration: underline;
}
a:hover font {
color: blue;
text-decoration: underline;
}
</style>
<a href=#> <font color=red> 123 </font> 456 </a>