CSS3 Box Shadow on Top, Left, and Right Only

前端 未结 10 1699
终归单人心
终归单人心 2020-12-15 03:24

Greetings,

I am trying to apply a CSS3 box shadow to only the top, right, and left of a DIV with a radius that matches the result of the following CSS (minus the bot

10条回答
  •  攒了一身酷
    2020-12-15 03:40

    Adding a separate answer because it is radically different.

    You could use rgba and set the alpha channel low (to get transparency) to make your drop shadow less noticeable.

    Try something like this (play with the .5)

    -webkit-box-shadow: 0px -4px 7px rbga(230, 230, 230, .5);
    -moz-box-shadow: 0px -4px 7px rbga(230, 230, 230, .5);
    box-shadow: 0px -4px 7px rbga(230, 230, 230, .5);
    

    Hope this helps!

提交回复
热议问题