<分区>
我为我的主站点链接设置了以下默认样式:
a {
color: #000;
text-decoration: none;
}
a:visited,
a:focus,
a:active {
color: #000;
}
a:hover {
color: red;
}
a:focus {
outline: thin dotted;
}
a:hover,
a:active {
outline: 0;
}
在设置其他链接的样式时,我遵循相同的模式,例如:
.button {
color: #fff;
background: #000;
}
.button:visited,
.button:focus,
.button:active {
color: #fff;
}
.button:hover {
color: #000;
background: #fff;
}
是否有必要为其他链接包含焦点轮廓样式,或者浏览器会回退到我的默认设置吗?我知道拥有正确的焦点样式将有助于可访问性。
最佳答案
如果“分类”链接上的 :focus
伪类与主链接没有区别,则无需再次声明。
关于html - 添加一个 :focus outline to all links,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31382652/