本文介绍了对div元素的模糊效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 div 元素上添加高斯模糊?如果是,我该怎么做呢?

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

推荐答案

我认为这是您要找的?如果您要为div元素添加模糊效果,可以通过CSS过滤器直接完成此操作 - 请参阅fiddle:

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;

}

这篇关于对div元素的模糊效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 18:13
查看更多