日期:2014-05-19  浏览次数:20629 次

超链接a标签只能设置一次样式吗???????????????????????????????????
HTML code

<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>



------解决方案--------------------
我拷贝了你的代码测试,正常啊main为黄色,content是另一种颜色
------解决方案--------------------
真的没问题,lz你的浏览器讲的可能是众生平等。。。
------解决方案--------------------
好吧。楼主 你看看你main的div关闭在哪。。。。被你吭了。。。。。
<div class="main">
<a href="a.html">main</a>
<div class="content">
<a href="a.html">content</a>
</div>
</div>