Responsive circle and image fit on circle

前端 未结 4 365
深忆病人
深忆病人 2021-01-23 17:38

I want to create a responsive circle and I want to fit the image. I want to use img tag not with css (background)

Here is what i\'ve tried

.         


        
4条回答
  •  无人共我
    2021-01-23 17:50

    You can try to do it with SCSS. You just need to create one variable.

    $width: calc(100vw / 5);
    .circle {
      width: $width;
      height: $width;
      border-radius: 50%;
      float: left;
      margin: 5px;
      background: red;
      overflow: hidden;
    }
    Please see the fiddle

提交回复
热议问题