为什么我的z-index被忽略? [英] Why is my z-index being ignored?

查看:118
本文介绍了为什么我的z-index被忽略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,请让我说我对CSS很新。还有很多要学!我在 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 http://www.thesweet-spot.com/test77

一切都很好,除了主内容框被放置在固定位置标识下,而不是在它上面,即使标识上的z-index低于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-index是一个z-index仅适用于绝对位置,固定位置或相对位置的元素。它不适用于具有静态位置的元素。

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天全站免登陆