下面的例子中,a标签里包含了一个span,我们可能希望当鼠标移到a上时,span的样式发生变化,但是在ie6下发现无效 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title></title> <style type="text/css"> a:hover span{font-weight:bold;color:#F00} </style> </head> <body> <a href="#">鼠标移过来看看这个网址是否变颜色:<span>www.liehuo.net</span></a> </body> </html> <br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>提示:可修改后代码再运行! 解决方法:(定义a:hover的样式,如font-size:12px,或者zoom:1等) <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title></title> <style type="text/css"> a:hover{font-size:12px} a:hover span{font-weight:bold;color:#F00} </style> </head> <body> <a href="#">鼠标移过来看看这个网址是否变颜色:<span>www.liehuo.net</span></a> </body> </html> <br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>提示:可修改后代码再运行! 文章导航 JavaScript动态添加信息的实现纯CSS3文字渐变内发光投影效果