473,508 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Absolutely positioned element disappears behind floating element in IE7

Banfa
9,065 Recognized Expert Moderator Expert
This page contains a cut down version of this page.

They both display the same problem, when the menu at the top is dropped down in IE7 the menu (which is positioned absolutely) disappears behind the floated items in the main content below it. (the second page is really given to show the context otherwise the display choices in the first page would appear slight odd).

The pages both work fine in FF 3 and Opera 9.5 (and FF 2 if memory serves me right) and both validate (HTML and CSS).


Is there a solution to this problem, other than redesigning the menu not to use floating items?
Jul 5 '08 #1
3 6586
drhowarddrfine
7,435 Recognized Expert Expert
I don't have IE with me. It's probably one of three IE bugs. Try adding 'position:relative' to one of the two divs, forgot which one. If that doesn't do it, try adding 'height:1%' to the parent div. If that doesn't work, I'd have to look up the 3rd one.

Actually, this is a common IE problem but I never remember the fix off the top of my head.
Jul 5 '08 #2
Banfa
9,065 Recognized Expert Moderator Expert
Thanks for the reply Doc, I tried those solutions but rather than make IE work they caused FF to stop working (in fact act in exactly the same way as IE).

However I cam up with the fix after a little digging and thought and discussion with work colleagues.

This can all be fixed with z-index I believe. However it is important to note that IE interprets z-index in a different way to all the other browsers. For all the other browsers z-index is absolute, An element with a z-index of 20 always appears above an item with a z-index of 10. In IE z-index is relative what is import is not the z-index of the element you are concerned with but the z-index of element that contains the element you are concerned with that has a sibling that contains the interfering element.

Take a simple example DOM

[html]
<div id="D1">
<div id="D11">
</div>
</div>
<div id="D2">
<div id="D21">
</div>
</div>
[/html]

Assume there is some positioning that causes D11 to occupy the same screen space as D21. If you want D11 to appear on top of D21 then in FF and Opera the z-index of D11 must be higher than the z-index of D21. However in IE this doe not work to get D11 on top of D21 in IE you need the z-index of D1 to be greater than the z-index of D2.

Without this extra z-indexing IE ignores the z-index of D11 being greater than the z-index of D21 because at the level where the elements in question have containing elements that are siblings the element containing D11 is low in the z-index than the element containing D21.
Jul 8 '08 #3
drhowarddrfine
7,435 Recognized Expert Expert
I didn't get to look up the 3rd option I mentioned above but mentioning z-index makes me think that was the 3rd option. It's all 'haslayout' related.
Jul 8 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2040
by: Travis Spencer | last post by:
Hello, I am having some problem with a statically positioned element being obscured by one that is absolutely positioned. To see what I am working on, go to...
4
2643
by: Christopher | last post by:
This should be a quick one. URL: http://cfa-www.harvard.edu/~cpilman/Stuff/flush.html Code: ============================= <!DOCTYPE HTML Public "-//W3C//DTD HTML 4.01//EN">...
3
6926
by: David Winter | last post by:
This is probably trivial, but I simply don't get it. I have a "position:absolute" type DIV with another one in it. I want the outer DIV to encompass the inner one. I.e., when the inner DIV...
7
4710
by: Jonas Smithson | last post by:
Hello all, I have an absolute positioned parent div, and nested inside it is an absolute positioned child div -- I mean the div *code* is nested inside, but the child is physically positioned so...
5
2504
by: Benjamin Esham | last post by:
Hello all, I have a very wide image that I want positioned in the extreme top left of the page. If the browser window is too narrow to contain the whole thing, that's fine-- the image should...
3
1779
by: John A Grandy | last post by:
on my WebForm, Panel1 is positioned absolutely , with settings for Top , Left , Width , Height ... Panel1 contains various sub-panels: PanelA , PanelB , PanelC ... these sub-panels' content...
2
5020
by: CRPietschmann | last post by:
I'm using the Microsoft Virtual Earth Version 1 Commercial Control. I want to make it so you can click on a pinpoint that's plotted on the map and all mouse events are passed to the map so that the...
5
3979
by: felipevaldez | last post by:
how can I put an element below another element, that's not absolutely positioned? so I have a n element, called X, and next to that, an element Y X Y XXXXXX
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.