Reputation: 3839
Is there anyway to blur an image with CSS
, specially for backgrounds?
Upvotes: 0
Views: 4312
Reputation: 19
Yes there is the way of blur images by the filter, you can read more about them here in the link. BUT they do not work properly for all browsers yet! And I didn't find a way to make them work for the background image.
Upvotes: 1
Reputation: 6848
Yes, there is.
You can use two different backgrounds, one with sharp color (the main picture) and another blurred picture:
body {
background: url(images/bg-solid.jpg) no-repeat;
}
#page-wrap {
background: url(images/bg-blurry.jpg) no-repeat fixed;
width: 500px; margin: 40px auto;
}
To see the detailed tutorial click here
EDIT:
For an image you can use svg filters as below:
The <feGaussianBlur>
element is used to create blur effects:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<filter id="f1" x="0" y="0">
<feGaussianBlur in="SourceGraphic" stdDeviation="15" />
</filter>
</defs>
<rect width="90" height="90" stroke="green" stroke-width="3"
fill="yellow" filter="url(#f1)" />
</svg>
Upvotes: 2
Reputation: 78971
This is not possible through CSS.
You have to process the image using a server-side language and generate a blurry one and then use it in the CSS backgrounds.
Upvotes: 0