未应用z-index [英] z-index isn't applied

查看:84
本文介绍了未应用z-index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,请允许我说我是CSS的新手.还有很多东西要学习!我正在使用 https:上的网站://web.archive.org/web/20130709112702/http://www.thesweet-spot.com/test77

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/test77

一切正常,除了将主要内容框放置在固定位置徽标下方而不是放置在固定位置徽标上方的情况下,即使徽标上的z索引低于内容框中的z索引也是如此.你的天才能告诉我什么?

Everything is working great, EXCEPT that the main content box is being placed under the fixed-position logo instead of over it, even though the z-index on the logo is lower than the z-index on the content box. What can you geniuses tell me?

推荐答案

实际上有两个原因:

  1. 其父级设置为在徽标后面中显示.应用于该父元素内的元素的任何z索引将仅应用于该父元素内的其他元素.父元素中的所有元素都将进行相应的堆叠,然后按照其堆叠顺序指定的方式将整个元素放置在徽标后面.

  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.

z索引仅适用于位置为绝对,固定或相对的元素.它不适用于具有静态位置的元素.

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

这篇关于未应用z-index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆