24

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

something like this:

enter image description here

Could this be done somehow with -webkit maybe?

Dr Robotnik
  • 352
  • 1
  • 4
  • 14

2 Answers2

37

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!

Jacob van Lingen
  • 8,989
  • 7
  • 48
  • 78
Dre
  • 2,933
  • 2
  • 18
  • 21
4

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/

Tim Ebenezer
  • 2,714
  • 17
  • 23