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

后端 未结 5 763
广开言路
广开言路 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:34

    The following CSS is sufficient :

    .profile-avatar {
      border-radius: 50%;
    }
    

    And the usage in html :

    
    

提交回复
热议问题