CSS3 box-shadow for overlapping-like divs

后端 未结 3 1847
难免孤独
难免孤独 2021-02-18 23:02

I\'m trying to achieve this effect with css3:

\"header/main\"

The HTML code is

3条回答
  •  佛祖请我去吃肉
    2021-02-18 23:45

    I just had some luck using relative positioning.

    For example.

    1st div has a box-shadow, and a bottom margin. 2nd div slides up under the shadow.

    #firstdiv {width: 960px; box-shadow: 5px 5px 5px #ccc; margin-bottom: 10px;}
    #seconddiv {width: 960px; position: relative; top: -10px;}
    

    It's not the best solution but it works for me.

提交回复
热议问题