CSS3 Question: how to have no box shadow on the top of a div?

前端 未结 2 1178
盖世英雄少女心
盖世英雄少女心 2021-02-11 17:39

Right now when I do this:

-moz-box-shadow: 0 0 200px #00C0FF;
-webkit-box-shadow: 0 0 200px #00C0FF;
box-shadow: 0 0 200px #00C0FF;

it gives a

2条回答
  •  温柔的废话
    2021-02-11 18:16

    box-shadow support multiple commas which mean this is possible and can be done like below:

    box-shadow: 2px 2px 3px #888, -2px 2px 3px #888;
    

    The first group bring shadow to the right & bottom while the second group bring shadow to the left (by using negative value) & bottom.

    The complete code for cross browser support is:

    -moz-box-shadow: 2px 2px 3px #888, -2px 2px 3px #888;
    -webkit-box-shadow: 2px 2px 3px #888, -2px 2px 3px #888;
    box-shadow: 2px 2px 3px #888, -2px 2px 3px #888;
    

提交回复
热议问题