我需要创造一个"打孔"戴着面具的效果。掩模和穿孔都需要应用Alpha透明度。
它适用于Firefox,但不适用于Chrome:http://codepen.io/anon/pen/WbbXKP
我做错了什么?
CSS:
body {
margin: 0;
padding: 0;
}
.pizza {
background: url(http://lorempizza.com/900/900/) center;
position:absolute;
width: 100%;
height: 100%;
}
.overlay {
top: 0;
left: 0;
opacity: .9;
position: absolute;
width: 100%;
height: 100%;
background: -moz-radial-gradient(50% 50% 45deg, circle cover, rgba(0,0,0,.8) 150px, rgba(0,0,0,1) 150px);
background: -webkit-radial-gradient(50% 50% 45deg, circle cover, rgba(0,0,0,.8) 150px, rgba(0,0,0,1) 150px);
background: -webkit-gradient(radial, 50% 50% 45deg, circle cover, rgba(0,0,0,.8) 150px, rgba(0,0,0,1) 150px);
}
HTML
<div class="pizza"></div>
<div class="overlay"></div>
答案 0 :(得分:0)
请尝试
background: -webkit-radial-gradient(50% 50%, circle cover,rgba(0,0,0,.8) 150px,rgba(0,0,0,1) 150px);
径向渐变不需要角度。只需删除45deg