为什么css定义的区域被锁定?(css3/选项卡式)

为什么css定义的区域被锁定?(css3/选项卡式),css,Css,我正在使用以下选项卡式css: 例六 .w3c { min-height: 250px; position: relative; width: 100%; } .w3c > div { display: inline; } .w3c > div > a { margin-left: -1px; position: relative; left: 1px; text-decoration: none; color: black; background: white; displa

我正在使用以下选项卡式css:

例六

.w3c { min-height: 250px; position: relative; width: 100%; }
.w3c > div { display: inline; }
.w3c > div > a { margin-left: -1px; position: relative; left: 1px; text-decoration: none; color: black; background: white; display: block; float: left; padding: 5px 10px; border: 1px solid #ccc; border-bottom: 1px solid white; }
.w3c > div:not(:target) > a { border-bottom: 0; background: -moz-linear-gradient(top, white, #eee); }   
.w3c > div:target > a { background: white; }    
.w3c > div > div { background: white; z-index: -2; left: 0; top: 30px; bottom: 0; right: 0; padding: 20px; border: 1px solid #ccc; }    
.w3c > div:not(:target) > div { position: absolute }
.w3c > div:target > div { position: absolute; z-index: -1; }
这将创建一个选项卡式区域,但我在选项卡内放置的任何内容都不可操作:我无法高亮显示,我无法创建链接。我不确定到底发生了什么,只是选择了这个例子,因为它很简洁。任何css专家都能解释为什么我似乎不能用这个做任何事情吗


注意:它非常适合我的需要,除了纯文本之外,我不能在选项卡中放置任何内容。

将上一条规则的
z-index
更改为
0
,您应该能够再次与选项卡的内容交互:

.w3c > div:target > div { position: absolute; z-index: 0; }

具有负
z-index
意味着任何具有零或正
z-index
的内容都将与选项卡重叠。其中一个很可能是页面
正文
,这会导致“禁用”选项卡内容。

我意识到分隔选项卡和内容的边框看起来不正确,但一开始看起来不正确。不过,我不确定修复方法。谢谢你…我使用了我输入的块的z索引,但没有用,我只是在解释这个css的实际功能。