相关疑难解决方法(0)

文字修饰不适用于访问状态链接

我是CSS的新手,试图了解如何根据状态更改来修改链接。在我的情况下,我想将链接更改text-decoration为“ line-through访问”状态。但是,在MozillaChrome浏览器上,当链接处于“ 访问”状态时,text-decoration文本内容都不会更新,如下所示。我哪里做错了?line-through

请注意,当链接状态更改为已访问但链接text-decoration保持不变时,颜色会更新(变为绿色)(请参阅演示1);

注意:Mozilla有关于同一问题的错误报告:Mozilla错误#645786和错误报告。tag.class:state 选择器(a.:visited)也会出现问题(请参阅演示#2

演示#1

<!DOCTYPE html>
<html>
    <head>
        <style>
            a:link {
                color: red;
                text-decoration: none;
            }

            a:visited {
                color: green;
                text-decoration: line-through;
            }

            a:hover {
                color: blue;
            }

            a:active {
                color: yellow;
            }
        </style>
    </head>
    <body>
        <p>
            <b>
                <a href="http://google.com" target="_blank">This is a link</a>
            </b>
        </p>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

演示#2-带类的选择器

<!DOCTYPE html>
<html> …
Run Code Online (Sandbox Code Playgroud)

html css firefox google-chrome text-decorations

0
推荐指数
1
解决办法
1576
查看次数

标签 统计

css ×1

firefox ×1

google-chrome ×1

html ×1

text-decorations ×1