The blur() filter in css also blurs nested images

Good afternoon. There is a css code that applies the blur filter(5px), but the fact is that it also puts a blur on nested img objects, how to treat this and how to deal with it?

.article_content_img{
    width: 100%;
    max-width: 1120px;
    height: 360px;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    -webkit-filter: blur(5px);
     -moz-filter: blur(5px);
       -o-filter: blur(5px);
      -ms-filter: blur(5px);
          filter: blur(5px);
}
.article-img{
    margin-bottom: 25px;
    width: auto;
    height: 360px;
    max-width: 1120px;
    max-height: 360px;
}

And here's what happens in the end: enter a description of the image here

Code structure:

div.article_content_img > img.article-img

How can this be treated? thanks.

Author: Kamil NHOT, 2017-04-26

2 answers

* {
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: #272727;
}

#wrapper {
  position: relative;
  width: 300px;
  height: 180px;
}

#foto {
  position: absolute;
  width: 300px;
  height: 180px;
  background-image: url(http://livefomdet.ru/uploads/images/f/o/t/foto_krasivih_jaguarov.jpg);
  background-size: 100%;
}

#blur {
  position: absolute;
  width: 300px;
  height: 180px;
  background: #ffffff77;
  filter: blur(7px);
}
<div id="wrapper">
  <div id="foto"></div>
  <div id="blur"></div>
</div>
 1
Author: Air, 2017-11-11 16:58:15

I see two solutions:

  1. Do not use blur, but use a blurred png (which I strongly recommend doing!! For blur does not load the page weakly). If you need a smooth change of blur, then I use two images (with and without blurring). Add the opacity: 0 and transition properties, then set the transparency to :hover. That is, when hovering, background changes smoothly. Well, or not when hovering, add the action that is required;

  2. Take out these two elements in a separate div. One of them can be easily stretched and they will be on top of each other.

 0
Author: Nikolay, 2017-04-26 14:28:21