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

前端 未结 8 1624
生来不讨喜
生来不讨喜 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:34

    You stated you want circular crops from recangles. This may not be able to be done with the 3 popular bootstrap classes (img-rounded; img-circle; img-polaroid)

    You may want to write a custom CSS class using border-radius where you have more control. If you want it more circular just increase the radius.

    .CattoBorderRadius
    {
        border-radius: 25px;
    }

    Fiddle URL: http://jsfiddle.net/ccatto/LyxEb/

    I know this may not be the perfect radius but I think your answer will use a custom css class. Hope this helps.

提交回复
热议问题