仅模糊背景图像

时间:2013-02-06 00:01:10

标签: css

你可以看到页面顶部的两个图像是在链接中给出的模糊,一个是背景图像,一个是上面的图像,两个都是模糊的我想要的只是模糊背景图像不是最重要的我不知道如何做到这里请帮助这里是链接http://www.node.au.com/projects/at38/

这是我的css

 #work-gallery 
  {
   background-repeat:no-repeat;
   background-size:cover;
   -webkit-filter: blur(5px);
  }

这是顶级图片的html,我不想模糊

 <div id="slideshow" style="margin-top: 17.5px;"> 
   <ul id="fdgSlides" style="width: 1275px; height: 425px; left: 0px;">
     <li class="fdgSlide" style="width: 1275px;">
       <img src="node.au.com/wp-content/uploads/thumb_at38_01.jpg"; alt="" style="width: auto; height: 100%; margin-top: -212.5px;"> 
     </li>  
    </ul>
 </div>

2 个答案:

答案 0 :(得分:7)

制作单独的背景元素:

<强> HTML

<div id="gallery-background"></div>

<强> CSS

#gallery-background {
    position: absolute;

    top: 0;
    left: 0;
    bottom: 0;
    right: 0;

    background-image: url(http://www.node.au.com/wp-content/uploads/thumb_at38_01-450x300.jpg);
    background-repeat:no-repeat;
    background-size:cover;
    -webkit-filter: blur(5px);
}

-webkit-filter会影响您应用它的元素的子元素,因此您必须移出背景。

答案 1 :(得分:0)

我在fiddle

中找到了解决方案
<div> 
</div>
<p><span>WOW</span></p>

div {
    height:500px;
    width:100%;
    text-align:center;
    background:url('http://i0.kym-cdn.com/photos/images/original/000/051/726/17-i-lol.jpg?1318992465') no-repeat center;
    background-size:cover;
    -webkit-filter: blur(13px);
    -moz-filter: blur(13px);
    -o-filter: blur(13px);
    -ms-filter: blur(13px);
    filter: blur(13px);
    position: absolute;
    left:0;
    top: 0;
}
p {
    position: absolute;
    left:0;
    top: 0;
}
span {
    color:blue;
    font-size:50px;
    font-weight:bold;
    position:relative;
    position:absolute;
    z-index:9999;
    -webkit-filter: blur(0px);
    -moz-filter: blur(0px);
    -o-filter: blur(0px);
    -ms-filter: blur(13px);
    filter: blur(0px);
}
相关问题