CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 26th, 2012, 09:00 PM
daprezjer's Avatar
daprezjer daprezjer is offline
hiding my <b> from ur <strong>
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2004
Posts: 936 daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 6 Days 3 h 50 m 25 sec
Reputation Power: 180
Z-index positioning within multiple boxes in IE7

A real simple z-index problem. Easiest just to show:

http://jsfiddle.net/C6fPQ/2/

I'm trying to get the red box, which is absolutely positioned inside the blue box, to hover over the same blue box below it, and it needs to be cross-browser compatible back to IE7. This code works in other browsers, but not IE7. I've tried making z-index of the outer blue box 0, but that actually makes it not work on IE7 and all other modern browsers. Not sure why as I'd think the z-index of the inner div would supercede that of the outerdiv, but in any case...

Thanks for any help you may be able to give,
Jeremy

P.S. I've googled the error and found this advice but I can't apply a higher z-index to the initial parent because the blue divs will have the same class.

http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/



<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
.bluebox {
background-color:blue;
margin-bottom:5px;
position:relative;
width:100px;
height:100px;
}

.redbox {
display:block;
position:absolute;
top:75px;
left:0px;
height:50px;
width:50px;
background:red;
z-index:5;
}
</style>
</head>
<body>
<div class="bluebox">
<div class="redbox"></div>
</div>
<div class="bluebox"></div>
</body>
</html>​
__________________
****
Enjoy my post? Drop some props by hitting the scales button up top. JBL

Website Design in Los Angeles and Washington, DC by PoweredPages.com

Last edited by daprezjer : November 26th, 2012 at 09:06 PM.

Reply With Quote
  #2  
Old November 26th, 2012, 09:20 PM
daprezjer's Avatar
daprezjer daprezjer is offline
hiding my <b> from ur <strong>
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2004
Posts: 936 daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level)daprezjer User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 6 Days 3 h 50 m 25 sec
Reputation Power: 180
Update, I found the answer here, which is kind of a ridiculous workaround but gets the job done:

http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/

If you know of a better way, feel free to let me know, but seems that the 'net' has settled on this one.
Comments on this post
Kravvitz agrees!

Reply With Quote
  #3  
Old November 26th, 2012, 11:51 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,831 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 1 Day 19 h 19 m 2 sec
Reputation Power: 4192
Congratulations on finding a solution and thanks for posting it.

I'm not aware of a better solution.
__________________
Spreading knowledge, one newbie at a time. I'm available for hire at Dynamic Site Solutions.

Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

Remember people spend most of their time on other people's sites (so don't violate web design conventions).

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Z-index positioning within multiple boxes in IE7

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap