CSS3 filter Blur Effect

Source: Internet
Author: User

Recently in making a CSS3 filter blur effect, but I found that some browsers have no effect, this is caused by browser compatibility, afraid to forget in the future, so write down first, also hope to help the needs of the small partners.

The code is as follows:

div{//Setting Translucent filter Effects

opacity:0.5;
Filter:alpha (OPACITY=50);

}

1, Filter: Set the translucent filter effect on IE, Filter:alpha (opacity=50) represents the object 50% translucent, support IE8 and the following browsers.
2, OPACITY:CSS3 property, all browser support except IE, including Google, Firefox, IE9 and above browser.

div{//setting Blur filters

-webkit-filter:blur (3PX);

-moz-filter:blur (3PX);

Filter:url (Blur.svg#blur);

Filter:progid:DXImageTransform.Microsoft.Blur (pixelradius= ' 3 ');

Filter:blur (3PX);

}

1. Attributes have not yet become part of the world standard, so you need to add a prefix, currently only-webkit-filter:blur (3px) prefix for Chrome browser support.

2.firefox does not support such direct write-moz-filter:blur (3px), the need to introduce blur.svg files to complete the same as other browser-like Blur effect, and the file in the code is such a drop:

<svg version= "1.1" xmlns= "Http://www.w3.org/2000/svg" >
<filter id= "Blur" >
<fegaussianblur stddeviation= "3"/>
</filter>
</svg>

As long as the introduction of the file in the CSS style is OK, the introduction of the style is as follows: Filter:url (Blur.svg#blur);

3.IE Browser directly through the wording of the filter can be: Filter:progid:DXImageTransform.Microsoft.Blur (pixelradius= ' 3 '), but only support IE6~IE9,

IE10 and later IE11 are supported by SVG filters, but this demo is not valid under these browsers, why?

As if it does not support the use of Filter:url directly in CSS, the specific solution is still under study.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.