我试图在下面的代码中在div的背景图像上放置一个过滤器,在http://www.theverge.com/的主页上完成。老实说,我不知道如何绕过它。 这是我有:CSS过滤器背景图片
<a href="#">
<div id="box"></div>
</a>
<style>
#box{
background-image: url("http://goo.gl/pdyi7R");
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
border: 1px solid;
width: 500px;
height: 300px;
position: relative;
opacity: 0.5;
}
#box:hover {
background-color: red;
opacity: 5;
}
</style>
只是供参考:''div''''无效。 – putvande
在html5 @putvande它有效的锚'div's - http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element(你自称是一个开发人员在html5!) – Pete