<html>
<head>
<style type="text/css">
.main a{
color:yellow;
}
.main a:visited, a:link {
text-decoration:none;
color:yellow;
}
.main a:hover, a:active{
text-decoration:underline;
color:red;
}
.content a{
color:333333;/*为什么content的样式被main覆盖了????????????*/
}
.content a:link, a:visited {
text-decoration:none;
color:333333;
}
.content a:hover,a:active {
text-decoration:underline;
color:2F8AB5;
}
</style>
</head>
<body>
<div class="main">
<a href="a.html">main</a>
<div class="content">
<a href="a.html">content</a>
</div>
</div>
</body>
</html>

解决方案 »

  1.   

    我拷贝了你的代码测试,正常啊main为黄色,content是另一种颜色
      

  2.   

    好吧。楼主  你看看你main的div关闭在哪。被你吭了。。
    <div class="main">
                <a href="a.html">main</a>
                <div class="content">
                    <a href="a.html">content</a>
                </div>

            </div>