CSS Shadows all four sides of div

前端 未结 11 1536
青春惊慌失措
青春惊慌失措 2021-02-08 11:18

I want to achieve this in CSS - not CSS3 as I want it to be supported by all browsers

ie a div containing content, with the shadows on every side. The top area will be

11条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-08 11:46

    This should work in all browsers:

    
        .allSidesShadow {
            box-shadow: 2px 2px 19px #aaa;
            -o-box-shadow: 2px 2px 19px #aaa;
            -webkit-box-shadow: 2px 2px 19px #aaa;
            -moz-box-shadow: 2px 2px 19px #aaa;
    
            /* For IE 5.5 - 7 */
            /* for IE4 - IE7 */
            filter:
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=1, Color=#C4C4C4),
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=90, Color=#C4C4C4),
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=180, Color=#C4C4C4),
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=270, Color=#C4C4C4);
            -ms-filter: "
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=1, Color=#C4C4C4),
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=90, Color=#C4C4C4),
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=180, Color=#C4C4C4),
                progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=270, Color=#C4C4C4)
            ";
        }
    
    

提交回复
热议问题