CSS: create white glow around image

后端 未结 6 1724
眼角桃花
眼角桃花 2020-12-07 21:59

How can I create a white glow as the border of an unknown size image?

6条回答
  •  孤街浪徒
    2020-12-07 22:35

    @tamir; you cna do it with css3 property.

    img{
    -webkit-box-shadow: 0px 0px 3px 5px #f2e1f2;
    -moz-box-shadow: 0px 0px 3px 5px #f2e1f2;
    box-shadow: 0px 0px 3px 5px #f2e1f2; 
    }
    

    check the fiddle http://jsfiddle.net/XUC5q/1/ & your can generate from here http://css3generator.com/

    If you need it to work in older versions of IE, you can use CSS3 PIE to emulate the box-shadow in those browsers & you can use filter as kyle said like this

    filter:progid:DXImageTransform.Microsoft.Glow(color='red', Strength='5')
    

    you can generate your filter from here http://samples.msdn.microsoft.com/workshop/samples/author/filter/Glow.htm

提交回复
热议问题