z-index isn't applied

前端 未结 2 466
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 08:18

First off, please let me say I\'m pretty new to CSS. Still lots to learn! I\'m working on a site at https://web.archive.org/web/20130709112702/http://www.thesweet-spot.com/t

相关标签:
2条回答
  • 2020-12-09 08:25

    There's actually two reasons:

    1. Its parent is set to show up behind the logo. Any z-index applied to elements within that parent element will only apply to other elements within that parent. All the elements within the parent will be stacked accordingly, then that entire element will be put behind the logo as specified by its stack order.

    2. A z-index only applies to elements with position of absolute, fixed, or relative. It does not apply to elements with static position.

    0 讨论(0)
  • 2020-12-09 08:40

    It is constrained by the parent container's z-index. You cannot set a child to a higher z-index than the parent; it caps at the parent's value.

    You could make the stripes a background of the body tag and then set the container to have no background. Once that is done set container to a higher z-index.`

    0 讨论(0)
提交回复
热议问题