简体   繁体   English

CSS3模糊效果在悬停时导致怪异的阴影

[英]CSS3 Blur effect causes weird shadows on hover

I got an html page where there is a DIV element covering the whole background with a background image, This DIV has also Blurred css3 effect on it. 我有一个html页面,其中有一个DIV元素覆盖了整个背景,并带有背景图像,该DIV也对其具有模糊的css3效果。

When ever i hover on elements that sit above the blurred div i get alot of weird shadow bugs happening. 每当我将鼠标悬停在位于模糊div上方的元素上时,就会发生很多奇怪的阴影错误。

Chrome on OSX. Chrome在OSX上。

Attached screenshot: 附件截图: 在此处输入图片说明

Here is my background css: 这是我的背景CSS:

#background {
    -webkit-transform: translate3d(0,0,0);
    background-repeat: no-repeat !important;
    background-position: center  !important;
    background-attachment: center fixed;
    -webkit-transform: scale(1.1);
    height: 100%;
    width: 100%;
    position: absolute;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    z-index: -1;
    box-shadow: inset 0px 0px 230px 75px rgba(0,0,0,0.8);
    overflow: hidden;
    -webkit-transition: -webkit-filter 0.4s ease-in-out;
}

.backgroundblur {
    -webkit-filter: blur(5px);
    -moz-filter: blur(5px);
    -o-filter: blur(5px);
    -ms-filter: blur(5px);
    filter: blur(5px);
}

Maybe you could load your HTML with this sample. 也许您可以使用此示例加载HTML。 But I guess that problem is in #background element, coz there's shadow applied on it, and it look like your content is in that element also. 但是我想问题出在#background元素中,因为它上面有阴影,看起来您的内容也位于该元素中。

I tried to produce similar effect on <http://jsfiddle.net/zlajaa1/4s941ewz/> . 我试图在<http://jsfiddle.net/zlajaa1/4s941ewz/>上产生类似的效果。 Problem here is negative z-index value. 这里的问题是Z索引值为负。 So maybe you can try to play with that property also. 因此,也许您也可以尝试使用该属性。

For more help, attach HTML with this please. 如需更多帮助,请在此附加HTML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM