I have 3 DIV Elements on a website and this CSS:
#box-left, #box-middle, #box-right a {
text-decoration:none;
color:#000000;
}
it only seems to be working on the #box-right
element though.
Any ideas?
I have 3 DIV Elements on a website and this CSS:
#box-left, #box-middle, #box-right a {
text-decoration:none;
color:#000000;
}
it only seems to be working on the #box-right
element though.
Any ideas?
你必须把
#box-left a, #box-middle a, #box-right a {
text-decoration:none;
color:#000000;
}
逗号分隔符列表上的每个值本身就是一个选择器,它不与下一个元素组合:
#foo, .class p, #bar p:first-child a {
something;
}
相当于
#foo {
something;
}
.class p {
something;
}
#bar p:first-child a {
something;
}
尝试
#box-left a,
#box-middle a,
#box-right a {
text-decoration:none;
color:#000000;
}
因为它适用于所有 div 的锚标记。
最好给出一个锚标记类并直接应用该类。
您还没有将元素 a 放入您的选择器中,如果您必须连接多个 div 或类,请考虑创建一个新段落以很好地理解您的代码,如下所示:
#box-left a,
#box-middle a,
#box-right a {
text-decoration:none;
color:#000000;
}