How to crop rounded image in css

I need the angle of the profile image to be blurry. But in my code I can not get exactly.

I need the result to be as follows:

enter image description here

But my code, blurring the border repeats itself. Because the image without blur also has the same angle. It seems that the angle is repeating itself.

effet {
  width: 400px;
  height: 125px;
  margin: 0 auto 50px auto;
}
.profile-box {
  width: 150px;
  height: 150px;
  margin-left: 40px;
  border: none !important;
  padding: 19.5px 10px;
  display: block;
}
.min_cir {
  border-radius: 50%;
  border-radius: 50%;
  position: absolute;
  top: 0;
}
.filtre--r {
  -webkit-mask: -webkit-radial-gradient(center, closest-side, transparent 30%, black 80%);
  -webkit-mask: radial-gradient(closest-side at center, transparent 50%, black 110%);
  -webkit-filter: blur(2px);
  mask: url('#mask-radial');
  filter: blur(2px);
  transform: scale(1.1);
  position: absolute;
  top: 0;
}
<div class="profile-box">
  <div class="media">
    <a class="pull-left" href="">
      <div class="effet">
        <img class="filtre filtre--r min_cir" src="http://i.imgur.com/oH1698V.jpg" />
        <img class="min_cir" src="http://i.imgur.com/oH1698V.jpg">
      </div>
    </a>
  </div>
</div>
Run code

I need to crop a non-blurry image according to the width of the blur angle.

+4
source share
2 answers

You can do the following:

First remove the scaling, as it will appear as a repetition of the image.

div css . div imgDiv

div , .. imgDiv, overflow:hidden ( div - 50px ( 15px)) .

. , .

effet {
  width: 400px;
  height: 125px;
  margin: 0 auto 50px auto;
}
.profile-box {
  width: 150px;
  height: 150px;
  margin-left: 40px;
  border: none !important;
  padding: 19.5px 10px;
  display: block;
}
.min_cir {
  border-radius: 50%;
  border-radius: 50%;
  position: absolute;
  top: -20px;
  left: -20px;
}

.filtre--r {
  -webkit-mask: -webkit-radial-gradient(center, closest-side, transparent 30%, black 80%);
  -webkit-mask: radial-gradient(closest-side at center, transparent 50%, black 110%);
  -webkit-filter: blur(4px);
  mask: url('#mask-radial');
  filter: blur(4px);
  position: absolute;
  top: 0;
  left:0;
 
}

.imgDiv{
    border-radius: 50%;
    height: 266px;
    left: 20px;
    overflow: hidden;
    position: absolute;
    top: 20px;
    width: 660px;
}

img{
   width: 700px;
  height: 306px;
}
<div class="profile-box">
  <div class="media">
    <a class="pull-left" href="">
      <div class="effet">
        <img class="filtre filtre--r min_cir" src="http://i.imgur.com/oH1698V.jpg" />
        <div class="imgDiv">
            <img class="min_cir" src="http://i.imgur.com/oH1698V.jpg">
        </div>
      </div>
    </a>
  </div>
</div>
+1

scale() ( , ). , , scale(). 1.1 . , ( ), ( ). scale(), , : transform: scale (1.09, 1.13);

+1

Source: https://habr.com/ru/post/1628786/


All Articles