HTML Element Style How to - Blur image








Question

We would like to know how to blur image.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#css-filter-blur {<!--  w  w w.ja va  2 s  . c  o  m-->
  margin: 20px;
}

#css-filter-blur:hover {
  -webkit-filter: blur(2px);
  filter: url(#blur-effect-1);
}
</style>
</head>
<body>
  <img id="css-filter-blur"
    src="http://placehold.it/200x200"
    alt="Blur" height="200" width="300" />
</body>
</html>

The code above is rendered as follows: