Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use -webkit-filter: blur(); on background-image?

Tags:

css

Is it possible to use -webkit-filter: blur(); on background-image?

I have tried this code and it just blurs everything but the background-image:

body {   background-image: url('http://www.publicdomainpictures.net/pictures/10000/velka/pebbles-and-sea-11284647414Rbeh.jpg');   background-attachment: fixed;   -webkit-filter: blur(5px); } 

I have been searching for a while but cannot find anyone resources describing how to do this.

like image 627
Elijah Lynn Avatar asked Oct 31 '12 22:10

Elijah Lynn


People also ask

Can you blur background on an existing photo?

Blurring photos on AndroidStep 1: Click the large Portrait button. Step 2: Grant permission to access photos, then select the photo you wish to alter. Step 3: The app will then immediately analyze and blur your background automatically.

Which tool is used to blur the background of the image?

The Funky Focus tool is the most versatile of all the blur tools. You can use it to create a tilt-shift effect, enhance depth of field, and add photo effects like pixelation and black and white to the blurred areas.


Video Answer


1 Answers

FUTURE USERS: This is not supported in IE7, IE8, IE9, IE10, IE11 or the current version of EDGE.

DO NOT USE on a real site, unless you have a fallback.

If you're looking for a solution that doesn't rely on extra markup, you could apply the background image and filter to a pseudo element on the body.

body {     position: absolute;     top: 0; bottom: 0; left: 0; right: 0;     height: 100%; } body:before {     content: "";     position: absolute;     background: url(http://lorempixel.com/420/255);     background-size: cover;     z-index: -1; /* Keep the background behind the content */     height: 20%; width: 20%; /* Using Glen Maddern's trick /via @mente */      /* don't forget to use the prefixes you need */     transform: scale(5);     transform-origin: top left;     filter: blur(2px); } 

Check it out this JsFiddle.

like image 195
JuanOjeda Avatar answered Sep 18 '22 19:09

JuanOjeda