CSS Shadows all four sides of div

前端 未结 11 1509
青春惊慌失措
青春惊慌失措 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:42

    Box Shadow works in all mordern [IE>8] browsers, This code uses no images and works in all browsers in IE versions below 9.

     box-shadow:2px 2px 10px 10px #C9C9C9;
     -webkit-box-shadow:2px 2px 10px 10px #C9C9C9;
     -moz-box-shadow:2px 2px 10px 10px #C9C9C9;
    
      /* For IE<9 */  
      filter:
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=0,strength=5),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=45,strength=2),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=90,strength=5),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=135,strength=5),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=180,strength=10),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=225,strength=5),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=270,strength=5),
      progid:DXImageTransform.Microsoft.Shadow(color=#C9C9C9,direction=315,strength=2);
    

    Box shadow supported from IE 9 onwards.

提交回复
热议问题