我在写css时遇到错误,如下所示:
.text {
margin-left: 20px;
color: #fff;
display: none;
transition: all 0.5s ease-in-out;
transition-delay: 0.3s;
a, a:visited {
font-size: 36px;
color: #fff;
text-decoration: none;
font-weight: bold;
display: block;
}
}
我不能做.a之类的事吗?在.text内部访问?我对这个琐碎的问题表示歉意。自从我使用CSS已经有一段时间了。提前非常感谢您:)
您需要这样写:
.text {
margin-left: 20px;
color: #fff;
display: none;
transition: all 0.5s ease-in-out;
transition-delay: 0.3s;
}
.text a, .text a:visited {
font-size: 36px;
color: #fff;
text-decoration: none;
font-weight: bold;
display: block;
}
或者您可以使用Sass,您的代码将是正确的
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句