【问题标题】:How to blur with css3 inside the parent's container box?如何在父容器框中使用 css3 进行模糊处理?
【发布时间】:2012-10-25 19:33:55
【问题描述】:

css3 模糊效果会忽略父容器尺寸并溢出。我需要使用 css3 进行内部模糊处理。这可能吗?有什么技巧吗?

html

<div class="box">
      <div class="blur">
           <img src="..." />
      </div>
</div>​

css

.box{
    width: 300px;
    height: 300px;
    border: 1px solid red;
}

.blur{
    -webkit-filter: blur(20px);
}

模糊溢出示例

http://jsfiddle.net/ngJEr/

【问题讨论】:

    标签: html css


    【解决方案1】:
    .box{
    width: 300px;
    height: 300px;
    border: 1px solid red;
    overflow:hidden;
    }
    
    .blur{
    -webkit-filter: blur(20px);
    }
    

    http://jsfiddle.net/calder12/ngJEr/8/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      • 2011-08-24
      • 1970-01-01
      相关资源
      最近更新 更多