The blur function

The blur function allows you to Gaussian blur background images.

Syntax

cssselector {
  filter: blur(blur radius);
}

Example

Let's set our image blur to 2px:

html<div id="elem"></div>
css#elem {
  filter: blur(2px);
  background-blend-mode: normal;
  background: url("bg.png") center / cover no-repeat,
  linear-gradient(#00A8DE, #FFF) fixed;
  width: 400px;
  height: 300px;
  border: 1px solid black;
}

Результат:

See also

  • the brightness function
    that sets a background brightness
  • the contrast function
    that sets a background contrast
  • the drop-shadow function
    that sets a background shadow
  • the hue-rotate function
    that sets a background hue
  • the invert function
    that inverts background colors
  • the opacity function
    that sets a background opacity
  • the sepia function
    that converts a background to sepia
  • the background property
    that is a shorthand property for a background
  • the background-image property
    with that you can set a background image for a block
  • the filter property
    that sets a background style