Home  >  Article  >  Web Front-end  >  Use CSS filters to create blurry images or text

Use CSS filters to create blurry images or text

PHPz
PHPzforward
2023-08-26 22:01:021337browse

使用 CSS 滤镜创建模糊的图片或文本

Motion Blur is used to create blurred pictures or text with direction and intensity.

The following parameters can be used in this filter

S.No

Parameters and description

1

Add

True or False . If true, the image is added to the blurred image; if false, the image is not added to the blurred image.

2

Direction

Blurred direction, clockwise Direction, rounded to 45 degree increments. The default value is 270 (left).

0 = Top

45 = Top right

90 = Right

135 = Bottom right

180 = Bottom

225 = Lower left

270 = Left

315 = Upper left

3

Strength

The number of pixels the blur will expand. Default is 5 pixels.

Example

You can try running the following code to blur the image

Live Demo

<html>
   <head>
   </head>
   <body>
      <img src = "/css/images/logo.png" alt="CSS Logo" style = "Filter: Blur(Add = 0, Direction = 225, Strength = 10)">
      <p>Text Example:</p>
      <div style="width: 357;
         height: 50;
         font-size: 30pt;
         font-family: Arial Black;
         color: blue;
         Filter: Blur(Add = 1, Direction = 225, Strength = 10)">CSS Tutorials</div>
   </body>
</html>

The above is the detailed content of Use CSS filters to create blurry images or text. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete