CSS box-shadow hidden (z-index does not fix)

前端 未结 3 1230
清歌不尽
清歌不尽 2021-01-31 06:52

I have a box-shadow on my #primaryNav div. Unfortunately, the shadow is being covered/hidden by the background of the following #page element.

3条回答
  •  情歌与酒
    2021-01-31 07:28

    You need to define positioning for #primaryNav. Z-index only affects positioned elements. I just added this in firebug and it fixed:

    #primaryNav {
      position: relative;
     }
    

    I would avoid using a negative z-index. Simply change z-index of #page to 0.

提交回复
热议问题