using a div to blur an image behind it? [duplicate]

℡╲_俬逩灬. 提交于 2019-11-26 13:56:31

问题


This question already has an answer here:

  • How to use CSS (and JavaScript?) to create a blurred, “frosted” background? 9 answers

Is it possible to code a div to enable it to blur whatever image is under it?

something like this:

Could this be done somehow with -webkit maybe?


回答1:


Not with CSS on its own, but you can pull a similar effect off with Canvas and the StackBlurforCanvas library. See this

UPDATE: Looks like backdrop-filter was recently introduced to Webkit nightly, so eventually we'll be able to do this with CSS only. Yay!




回答2:


Unfortunately this can't be done purely using CSS. Although webkit-filter supports blur, it doesn't support blurring anything other than the element that it applies to.

There is a more hacky way to do this, described here - http://css-tricks.com/blurry-background-effect/



来源:https://stackoverflow.com/questions/19687846/using-a-div-to-blur-an-image-behind-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!