【发布时间】:2015-12-04 07:27:24
【问题描述】:
我有一个<div>,我在其上应用了灰色过滤器,但<div> 内的所有其他元素也受到过滤器的影响。
即使我尝试通过更具体的方式覆盖元素, 例如
.div-id span { color: blue }
到目前为止,CSS 对我没有帮助。
我该如何解决这个问题?
HTML:
<div class="idea-box-tools text-center">
<span class="glyphicon glyphicon-wrench"></span>
<p class="box-headers">Dashboard & Tools</p>
<p class="box-paragraphs">Lorem ipsum dolor sit amet.</p>
</div>
CSS:
.idea-box-tools:hover {
background-image: url('includes/tools.jpg');
background-size: contain;
-webkit-filter: grayscale(80%) brightness(20%) contrast(100%);
}
【问题讨论】: