Can CSS3 box-shadow:inset do only one or two sides? like border-top?

后端 未结 11 1658
时光说笑
时光说笑 2021-01-30 04:44

I\'m wondering about the support for side specific inner shadows in css3.

I know this works great on supported browsers.

div { box-shadow:inset 0px 1px 5         


        
11条回答
  •  日久生厌
    2021-01-30 05:27

    For the same shadow but only on the top :

    box-shadow: inset 0px 6px 5px -5px black;
    

    To have the shadow in one direction you have to negate the "blur" parameter with the "spread" parameter and then adjust the "h-pos" and/or "v-pos" parameters by this same value. It doesn't work with opposite border or triple border. You have to add one more definition.

    More examples here : http://codepen.io/GBMan/pen/rVXgqP

提交回复
热议问题