<分区>
<分区>
如果我将多个伪元素/类应用到单个元素中,那么在处理两个/所有元素之前定义(为一个元素编写代码)很重要。
a:link{
color: cyan;
}
a:visited{
color:orange;
}
a:active{
color:yellow;
}
a:hover{
text-decoration:none;
font-size:1.4rem;
}
最佳答案
是的!顺序很重要。根据文档-
a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective! a:active MUST come after a:hover in the CSS definition in order to be effective!
关于css - 如果是 CSS 中的伪元素和类,顺序很重要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56864710/