html - 链接的访问者选择器没有更改字体大小和其他属性,为什么?

标签 html css

<分区>

我编写的代码是这样的:如果链接被访问,它的字体大小应该减小,文本应该被描边,颜色应该变成淡粉色。只有颜色在变,其他什么都没有变。

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

a:visited {
    text-decoration: line-through;
    font-size:0.2em;
    color:#ff6666;
}

a:hover {
    text-decoration: overline;
    color: #ff1a1a;
    font-size: 1.5em;
    
}

a:active {
    text-decoration: none;
    font-size: 2em;
    color: #800000;
}
</style>
</head>
<body>

<p><b><a href="http://www.facebook.com" target="_blank">This is a link</a></b></p>
<p><b>Note:</b> a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.</p>
<p><b>Note:</b> a:active MUST come after a:hover in the CSS definition in order to be effective.</p>

</body>
</html>

我的问题是为什么在访问链接时除了颜色之外其他参数没有改变?

最佳答案

允许的样式是:

color
background-color
border-color (and border-color for seperate sides)
outline color
column-rule-color
the color parts of fill and stroke

所有其他样式都继承自 a:link。

关于html - 链接的访问者选择器没有更改字体大小和其他属性,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35192821/

上一篇:html - Bootstrap 列不起作用

下一篇:html - 在响应容器中居中缩略图网格

相关文章:

每次单击按钮时,PHP 函数无法重新检查 IP 检查

javascript - 响应式网站 : how to keep on mobile, 默认悬停层元素 "on"

jquery - 单击时添加类并禁用 mouseleave 事件?

html - 宽度: auto; height: 100; and overflow: hidden does not work as expected

html - Div定位取决于图像大小?

html - div 的动态宽度(类似表格)

jquery - 如何垂直对齐中间到多个位置的绝对子div

javascript - 加载网页的一部分

jquery - 尝试让表格行悬停背景颜色与斑马条纹行一起使用

ios - 为什么在通过 javascript 设置列宽和间距后 UIWebView 不重排文本?