How to make a circular image in css

前端 未结 3 977
醉话见心
醉话见心 2021-01-12 15:39

I\'m very new to this sort of thing but this is my issue. I\'ve looked through a couple of questions and it makes sense with how to make it circular but the image which is m

3条回答
  •  醉酒成梦
    2021-01-12 16:22

    You have to set the border-radius to the img itself, not to the containing div. As you know images are square or rectangular and putting them inside something circle will of course cut off the boundaries.

    img { 
        border-radius: 50%; 
        width: 100px;
        height: 100px;
    }
    

    Here is the fiddle: http://jsfiddle.net/LLo1u3Ld/2/

提交回复
热议问题