简体   繁体   中英

Absolute z-index issue in IE when expand hidden content

I have a problem with position of a block (div). I am newbie in CSS, please help me.

I have this code: http://jsfiddle.net/9rEmt/ (please take a look there) to view online in IE.

If I put absoulte at positioning, the issue appears: (please choose Compatibility mode if you have newer version of IE )

在此处输入图片说明

instead of (without compatibility mode, just simply in IE9) :

在此处输入图片说明

Where is the problem ? How to solve this issue ?

Thank you very much

In IE to position an element relative to another element the parent element needs to e positioned itself.

Try to add this to your stylesheet:

#item { 
    position: relative;
    top: 0px;
    left: 0px;
}

Also, move the items div into the item div so that items is able to be positioned relative to item .

http://jsfiddle.net/U92jm/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM