Home Web Front-end CSS Tutorial How to set Gaussian blur effect in css

How to set Gaussian blur effect in css

Nov 30, 2021 pm 06:30 PM
css

In CSS, you can use the filter attribute and blur() function to achieve the Gaussian blur effect. The filter attribute is used to set the visual effect of image elements. Use it with the blur() function to add a Gaussian blur effect to image elements. , the syntax is "picture element {filter:blur(blur value);}".

How to set Gaussian blur effect in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to set Gaussian blur effect in css

We can set Gaussian blur to the image through the filter attribute. The filter attribute defines the element ( Typically visual effects (e.g. blur and saturation) of How to set Gaussian blur effect in css).

When the attribute value is blur(px), set Gaussian blur to the image. The "radius" value sets the standard deviation of the Gaussian function, or how many pixels are blended together on the screen, so the larger the value, the blurr it is;

If no value is set, the default is 0; this parameter can Set css length value, but does not accept percentage value.

Let’s take a look at it through an example:

nbsp;html>


    <meta>
    <meta>
    <meta>
    <title>Document</title>


    <style>
.img1 {
    filter: blur(5px);
}
    </style>
  <img  class="img1 lazy" src="/static/imghw/default1.png" data-src="1118.02.png" alt="How to set Gaussian blur effect in css" >
  <img  class="img2 lazy" src="/static/imghw/default1.png" data-src="1118.02.png" alt="How to set Gaussian blur effect in css" >

Copy after login

Output result:

How to set Gaussian blur effect in css

(Learning video sharing: css video tutorial )

The above is the detailed content of How to set Gaussian blur effect in css. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What does placeholder mean in vue What does placeholder mean in vue May 07, 2024 am 09:57 AM

What does placeholder mean in vue

How to write spaces in vue How to write spaces in vue Apr 30, 2024 am 05:42 AM

How to write spaces in vue

How to get dom in vue How to get dom in vue Apr 30, 2024 am 05:36 AM

How to get dom in vue

What does span mean in js What does span mean in js May 06, 2024 am 11:42 AM

What does span mean in js

What does rem mean in js What does rem mean in js May 06, 2024 am 11:30 AM

What does rem mean in js

How to introduce images into vue How to introduce images into vue May 02, 2024 pm 10:48 PM

How to introduce images into vue

What is the function of span tag What is the function of span tag Apr 30, 2024 pm 01:54 PM

What is the function of span tag

How to wrap prompt in js How to wrap prompt in js May 01, 2024 am 06:24 AM

How to wrap prompt in js

See all articles