【发布时间】:2026-01-13 00:10:02
【问题描述】:
我继承了一些 Sass,如下所示。我希望能够指定一个 CSS 标记来区分绿色和另一种颜色(请参阅锚标记和注释)。
现在,我有-
<div class="names"></div>
链接显示为绿色。我希望能够做类似的事情-
<div class="names myblue"></div>
改为使用不同的颜色。
&.SpeakerCount3 {
.names {
text-align: center;
li {
text-align: center;
display: inline-block;
width: 82px;
margin-left: 5px;
&:first-child {
margin-left: 0;
}
}
img {
max-width: 100%;
}
h3 {
margin-top: 0;
a {
font-size: 10px;
}
}
}
}
.names {
min-height: 180px;
.photo {
margin-top: -21px;
}
img {
display: block;
border: 3px solid #282828;
margin: 0 auto;
}
h3 {
margin-top: 5px;
}
a {
font-size: 20px;
color: #5c5c5c; // this was green but I could not figure how to make it orange for css and green for kids
text-decoration: none;
}
}
.description {
margin-bottom: 15px;
min-height: 120px;
h3 {
margin: 5px 0 20px 0;
min-height: 40px;
}
}
【问题讨论】:
-
您希望链接的子项具有绿色吗? “CSS 的橙色”和“儿童的绿色”cmets 不清楚。
-
我想使用相同的 sass 文件来创建一个绿色链接(它现在这样做)以及能够让它创建一个橙色链接。我还没有任何会呈现橙色的标签。也就是说,我希望我的 html 能够指示我想要哪一个,同时保留上面 sass 中的所有其他属性
标签: css sass compass-sass