how to set shadow for round image(css)

前端 未结 10 2052
暖寄归人
暖寄归人 2020-12-31 11:52

I\'m new to shadow in css can we set shadows for round image(i mean to a circle image).

if it is possible, please give me a code for this in css. thanks in advan

10条回答
  •  不思量自难忘°
    2020-12-31 12:19

    CSS3 box shadows apply shadows to the element, not the content of the element. In other words if you have an image (which is rectangular) but the image itself is of a circle, the shadow will be applied to the rectangular image element, not the actual subject of the image.

    UPDATE:

    Of course, you can always use the canvas element to play with shadows. Here's a jsFiddle example of both drawing a circle and loading a circle, then applying a shadow effect to both.

提交回复
热议问题