a:link, a:visted, a:hover, and a:active not working?

ⅰ亾dé卋堺 提交于 2019-12-12 01:05:55

问题


I've used a:hover before; I don't know why it isn't working now. Here's the code.

<style>

    body {
    margin: 0px;
    background-color: #F0F0EE;
    }

    p {
    font-family: Arial;
    color: #2B2B2B;
    font-size: 13px;

    a:link {
        font-family: Arial;
        color: #557777;
        text-decoration: none;
        border: none;
    }

    a:visited {
        font-family: Arial;
        color: #557777;
        text-decoration: none;
        border: none;
    }

    a:hover {
        font-family: Arial;
        color: #3F7F77;
        text-decoration: none;
        border: none;
    }

    a:active {
        font-family: Arial;
        color: #557777;
        text-decoration: none;
        border: none;
    }

</style>

The links appear like the default links for some reason. (They are purple because I have already visited them and they are underlined.)


回答1:


You need to close your p {} selector with the last }

p {
font-family: Arial;
color: #2B2B2B;
font-size: 13px;

} <---------

a:link {


来源:https://stackoverflow.com/questions/20830812/alink-avisted-ahover-and-aactive-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!