开发者

z-index and anchor tag

开发者 https://www.devze.com 2022-12-17 07:13 出处:网络
I have a div with position relative and z-index :-1. and I have placed <A> over that div. But it seems <a> is not working when i give postion :relative to its parent. when change that

I have a div with position relative and z-index :-1. and I have placed <A> over that div. But it seems <a> is not working when i give postion :relative to its parent. when change that position to absolute it starts working. Could anybody tell me why this is happening. I want that link 开发者_如何学JAVAto work and as far as possible need to keep its parent div position :relative and z-index:-1;


position:relative will make the z-index relative to the parent.

http://www.w3.org/TR/CSS21/visuren.html#propdef-z-index


Negative z-index cause a links to not work:

See this fiddle

0

精彩评论

暂无评论...
验证码 换一张
取 消