Bootstrap 3: Using img-circle, how to get circle from non-square image?

前端 未结 8 1393
生来不讨喜
生来不讨喜 2021-01-31 16:16

I have rectangular, not necessarily square images.

Using Bootstrap\'s img-circle, I\'d like to get circular crops, <

8条回答
  •  有刺的猬
    2021-01-31 16:42

    I use these two methods depending on the usage. FIDDLE

    div.img-div{ height:200px; width:200px; overflow:hidden; border-radius:50%; } .img-div img{ -webkit-transform:translate(-50%); margin-left:100px; } .circle-image{ width:200px; height:200px; border-radius:50%; background-image:url("http://placekitten.com/g/200/400"); display:block; background-position-y:25% }

提交回复
热议问题