Backdrop Filter extends beyond Border Radius

前端 未结 2 2027
滥情空心
滥情空心 2021-01-17 13:36

I\'m trying to use the CSS backdrop-filter and border-radius together, but the backdrop filter appears to extend beyond the border radius.

2条回答
  •  无人共我
    2021-01-17 14:06

    Until this fix is released, you can avoid this bug by using a 0px blur as a backdrop filter on the parent element. This requires the overflow to be hidden, so the edges of the K and M in your example are no longer visible.

    body {
      background: url("https://source.unsplash.com/random") center /cover;
      height: 100%;
      width: 100%;
    }
    
    .con {
      -webkit-backdrop-filter: blur(0);
      backdrop-filter: blur(0);
      margin: 1rem auto;
      width: 11rem;
      height: 11rem;
      overflow: hidden;
      border-radius: 50%;
      font-size: 7rem;
      font-weight: 300;
      line-height: 1.5;
      text-align: center;
      position: relative;
    }
    .inner {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      -webkit-backdrop-filter: blur(0.1em);
      backdrop-filter: blur(0.1em);
      border-radius: 50%;
      margin: -1px;
    }
    
      
    KM

提交回复
热议问题