css: fit rounded (circle) image (do not stretch it)

后端 未结 5 769
广开言路
广开言路 2020-12-29 04:50

For example I have such images:

and css:

.company-header-avatar{
    width: 60px;
    height: 60px;
    -webkit-border-radius: 60px;
    -w         


        
5条回答
  •  天命终不由人
    2020-12-29 05:35

    This did the work for me.

    .company-header-avatar{
      height: 60px;
      width: 60px;
      object-fit: contain;
      border-radius: 50%;
    }
    

提交回复
热议问题