Computer >> Computer tutorials >  >> Programming >> CSS

Create blurred picture or text with CSS Filters


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

The following parameters can be used in this filter

S.No
Parameter & Description
1
Add
True or false. If true, the image is added to the blurred image; and if false, the image is not added to the blurred image.
2
Direction
The direction of the blur, going clockwise, rounded to 45-degree increments. The default value is 270 (left).
0 = Top
45 = Top right
90 = Right
135 = Bottom right
180 = Bottom
225 = Bottom left
270 = Left
315 = Top left
3
Strength
The number of pixels the blur will extend. The default is 5 pixels.

Example

You can try to run the following code to blur an image

<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>