Absolute DIV not showing in IE6 / IE7 - Internet Explorer
Iv come across this problem a few times now and this should be of help to a few people.
When placing an absolute div within a relative positioned div, in IE6 and IE7 that div disappeared. The content within the div and the div just would not show. An immediate response would be to think of the stack and z-Index but after a few tests it wasnt that.
The Fix: Simply surround the absolute div with another empty div.
Did it work? Another similar problem? Leave a comment.
Comments
Thanks a bunch for this. You saved me a lot more wasted time. I waste more time finding IE workarounds.
By chris on 30th December 2010Wow I can’t believe that was so simple to fix! Thanks a lot, you saved me ripping my hair out for the next 6 hours
By Matt on 6th January 2011This helped me as well, it worked ! Thanks for posting.
By Alex on 9th February 2011THANKS! ![]()
You just answered a question I had been working on for DAYS! THANKYOU!!!
By Jason on 25th March 2011It did not work for me, can you give me advice?
This is what i did and it did not work.
<div>
<div id=“buttontop1”></div>
</div>
Here is the info:
The header.php code:
<!—Begin Custom Header Buttons and phone—>
<div id=“buttontop1”></div>
<!—end Custom Header Buttons and phone—>
The CSS code :
#buttontop1{
position: absolute;
z-index: 99;
height: 74px;
width: 206px;
top: 86px;
right: 13px;
}
#buttontop2 {
position: absolute;
z-index: 100;
height: 74px;
width: 214px;
top: 86px;
right: 228px;
}
#tel {
position: absolute;
z-index: 10;
top: 18px;
right: 0px;
color: #FFF;
width: 400px;
height: 50px;
font: bold 50px/normal Arial, Helvetica, sans-serif;
}
By Luis on 5th May 2011
IT WORKS! THANKS! :D
By Karl on 1st June 2011BRILLIANT, brilliant, brilliant—Thank you very much
By ArtizanatWeb on 18th October 2011Wow!! Wasted an hour on this! THANKS—
By julie on 26th October 2011Works. No idea why.
Thanks. Much.
By Sebastianz55 on 16th February 2012
This solved my problem. Thanks a lot! Any idea why an extra div is needed?
By Paul on 16th December 2010