Internet Explorer - CSS Shadow All Around

后端 未结 4 1104
梦如初夏
梦如初夏 2021-01-02 03:52

I have been ripping my hair out over this issue, I want a simple shadow that does around the whole element, besides for the top. I got it to work in Firefox and Chrome with

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 04:31

    Similar to Above Answer (See Note Below):

    #boxContainer{ 
       filter:
            progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=0, Color='#000000'),
            progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=90, Color='#000000'),
            progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=180, Color='#000000'),
            progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=270, Color='#000000');
    }
    

    Important: Keep in mind there's also a bug in IE where it will apply that same style to child elements. So you may need to apply a "counter"/"Nullifier" if you will.

    Example:

    #boxContainer button, #boxContainer div, #boxContainer span {
      /* Nullify Inherited Effect - Set "Strength=0" */
      filter:
        progid:DXImageTransform.Microsoft.Shadow(Strength=0, Direction=0, Color='#000000'),
        progid:DXImageTransform.Microsoft.Shadow(Strength=0, Direction=90, Color='#000000'),
        progid:DXImageTransform.Microsoft.Shadow(Strength=0, Direction=180, Color='#000000'),
        progid:DXImageTransform.Microsoft.Shadow(Strength=0, Direction=270, Color='#000000');
    }
    

提交回复
热议问题