Blur effect on a div element

后端 未结 4 1145
刺人心
刺人心 2020-12-13 17:16

Is it possible to add a gaussian blur on div element? If yes, how I can do this?

相关标签:
4条回答
  • 2020-12-13 17:22

    Try using this library: https://github.com/jakiestfu/Blur.js-II

    That should do it for ya.

    0 讨论(0)
  • 2020-12-13 17:30

    I got blur working with SVG blur filter:

    CSS

    -webkit-filter: url(#svg-blur);
            filter: url(#svg-blur);
    

    SVG

    <svg id="svg-filter">
        <filter id="svg-blur">
            <feGaussianBlur in="SourceGraphic" stdDeviation="4"></feGaussianBlur>
        </filter>
    </svg>
    

    Working example:

    https://jsfiddle.net/1k5x6dgm/

    Please note - this will not work in IE versions

    0 讨论(0)
  • 2020-12-13 17:46

    I think this is what you are looking for? If you are looking to add a blur effect to a div element, you can do this directly through CSS Filters-- See fiddle: http://jsfiddle.net/ayhj9vb0/

     div {
      -webkit-filter: blur(5px);
      -moz-filter: blur(5px);
      -o-filter: blur(5px);
      -ms-filter: blur(5px);
      filter: blur(5px);
      width: 100px;
      height: 100px;
      background-color: #ccc;
    
    }
    
    0 讨论(0)
  • 2020-12-13 17:47

    This is what I found:

    Demo: http://tympanus.net/Tutorials/ItemBlur/

    and Tutorial: http://tympanus.net/codrops/2011/12/14/item-blur-effect-with-css3-and-jquery/

    0 讨论(0)
提交回复
热议问题