【CSS小白】 li标签当中超链接字体无法修改的问题

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>淘宝女装分类页面</title>
    <style>
        ul {
            list-style: none;
        }

        h1 {
            font-size: 18px;
            font-weight: bold;
        }

        p {
            font-size: 12px;
            color: black;

        }

        .black {
            font-size: 12px;
            color: black;
        }

        a:link {
            text-decoration: none;
            color: black;
        }

        a:hover {
            color: #F60;
            text-decoration: underline;
        }
    </style>
</head>
<body>

<ul>

    <li>
        <h1><img src="image/dress01.png" alt="">夏季流行</h1>

        --------------------------------------------------------------------------------
        <p class="black">
            <a href="">夏季新品</a>&nbsp;
            <a href="">雪纺裙</a>&nbsp;
            <a href="">短袖T</a>&nbsp;
            <a href="">铅笔裤</a>&nbsp;
            <a href="">短裤</a>&nbsp;
            <a href="">短袖衬衫</a>&nbsp;
            <a href="">小脚牛仔裤</a>&nbsp;
            <a href="">开衫</a>&nbsp;
            <a href="">蕾丝/雪纺衫</a>&nbsp;
            <a href="">韩版外套</a>&nbsp;
            <a href="">小西装</a>&nbsp;
            <a href="">中长款裙</a>&nbsp;
        </p>


    </li>

    <li>
        <h1><img src="image/dress02.png" alt="">上装</h1>

        --------------------------------------------------------------------------------
        <p class="black">
            <a href="">T恤</a>&nbsp;
            <a href="">衬衫</a>&nbsp;
            <a href="">针织衫</a>&nbsp;
            <a href="">长袖T</a>&nbsp;
            <a href="">韩版T</a>&nbsp;
            <a href="">情侣衫</a>&nbsp;
            <a href="">雪纺衬衫</a>&nbsp;
            <a href="">韩版衬衫</a>&nbsp;
            <a href="">防晒衣</a>&nbsp;
            <a href="">休闲套装</a>&nbsp;
            <a href="">卫衣</a>&nbsp;
            <a href="">背心/吊带</a>&nbsp;
        </p>


    </li>


    <li>
        <h1><img src="image/dress03.png" alt="">裙子</h1>

        --------------------------------------------------------------------------------
        <p class="black">
            <a href="">连衣裙</a>&nbsp;
            <a href="">半身裙</a>&nbsp;
            <a href="">长裙</a>&nbsp;
            <a href="">短袖裙</a>&nbsp;
            <a href="">蕾丝连衣裙</a>&nbsp;
            <a href="">长袖裙</a>&nbsp;
            <a href="">无袖/背心裙</a>&nbsp;
            <a href="">A字裙</a>&nbsp;
            <a href="">牛仔裙</a>&nbsp;
            <a href="">半身中长裙</a>&nbsp;
            <a href="">半身短裙</a>&nbsp;
            <a href="">包臀裙</a>&nbsp;
        </p>

    </li>
    <li>
        <h1><img src="image/dress04.png" alt="">裤子</h1>

        --------------------------------------------------------------------------------
        <p class="black">
            <a href="">裤子</a>&nbsp;
            <a href="">休闲裤</a>&nbsp;
            <a href="">牛仔裤 </a>&nbsp;
            <a href="">打底裤</a>&nbsp;
            <a href="">长裤</a>&nbsp;
            <a href="">哈伦裤</a>&nbsp;
            <a href="">阔腿裤</a>&nbsp;
            <a href="">短裤/热裤</a>&nbsp;
            <a href="">连体裤</a>&nbsp;
            <a href="">七/九分裤</a>&nbsp;
            <a href="">牛仔短裤</a>&nbsp;
            <a href="">西装裤</a>&nbsp;
        </p>


    </li>
    <li>
        <h1><img src="image/dress05.png" alt="">其他女装</h1>

        --------------------------------------------------------------------------------
        <p class="black">
            <a href="">胖M装</a>&nbsp;
            <a href="">中老年</a>&nbsp;
            <a href="">婚纱</a>&nbsp;
            <a href="">礼服</a>&nbsp;
            <a href="">旗袍</a>&nbsp;
            <a href="">夜店</a>&nbsp;
            <a href="">舞台装</a>&nbsp;
            <a href="">唐装</a>&nbsp;
            <a href="">职业装</a>&nbsp;
            <a href="">全球购</a>&nbsp;
            <a href="">羊绒衫</a>&nbsp;
            <a href="">毛衣</a>&nbsp;
            <a href="">呢大衣</a>&nbsp;
            <a href="">羽绒服</a>&nbsp;
            <a href="">真皮皮衣</a>&nbsp;
        </p>


    </li>

</ul>


</body>
</html>

试了很多方法,用class选择器,用标签选择器,但是无论怎么弄,都是弄不起来,如图:
我的目标是做成这样:
clipboard.png

也就是超链接当中的字体应该是黑色的
但是实际上却是这样的:
这个字,死活改不了颜色,看不懂了。

clipboard.png

问题出在哪里呢?我应该如何修改?

阅读 2.4k
2 个回答

你没有给a标签设置样式,只设置了hover和link下的样式,所以一般情况下会使用a标签的默认样式

a{

color:#000

}

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题