z-index in IE7 not rendering properly - css

I am struggling to make a webpage backwards-compatible with IE7 (I know, 'IE7?!', but that's what is on our school computers). I am trying to show a div the full size of the page to darken the body and show two specific divs on top of that. However, when I view the page, the dark div appears over all other elements on the page - even those with a higher z-index.
You can see the page here and view it in IE7 using netrender.
I have applied positioning to all of the elements and it seems to have done nothing. Maybe it is just my eyes?

I think if you pulled the modal box div out of the #wrapper div, it might work. It appears older versions of IE compare sibling z-index values, so the #blackBg div is comparing itself to the #wrapper div, which has its z-index set to auto. If the modal box was a sibling to both and had its z-index higher, it just might solve the issue.

As far as I am concerned, it is not possible so I gave up in the end.

Related

webkit browsers hide LI A (display:block) elements. sometimes

I'm building (kinda experimental) menu which is built on classic 'ul li' base except 'a' elements are set to display:block to enable precise positioning and sizing. some transform:rotate also appears, but this does't influence following behaviour:
All browsers except webkit ones display all menu items here the same way (correctly). But webkit hides child items ('item 2a', 'item 2b', 'item 3a', ...). The links are apparently present as cursor changes while hovering over the area where they should appear, but they are not visible. Oddly enough, when I set size of these invisible elements to slightly overlap their designated space (height of their parent LI) they appear visible (here)
Do you know what's happening here?
Thanks.
Personally, I think negative margins and css rotation combined can be a bit of a pain.
If I was you I'd
Set the a.rotate links to absolute positioning, so they don't upset the flow.
Dump the negative margins
Play with it a bit
I made this example here: http://jsfiddle.net/958qQ/
The rest should be easy.
I don't like your method using margins, it's complicated. think it will better to style with positioning. absolute position for child elements

IE-7 Z-index problem

http://www.mimi.clickedsolutions.com/
in above site when selecting option in dropdown box right to search box in header options are going behind the header image or logo in IE-7
I think it the Z-index problem
i am facing this problem again and again and didnt get any effiecient solution yet
please suggest me the solutions
I'm on a ferry typing this on my phone, so I can't test your link, but...
In all browsers, z-index is relative to the nearest stacking context. In FF, Chrome, IE8, stacking context is most often created by having positioning (relative or absolute) and a z-index. In IE7, only positioning is needed to create a stacking context.
What this means is that in IE7, z-index only applies up to the nearest parent with any position property set.
To make all browsers behave like IE7, for sanity, add "z-index: 1" to any element that also has position set to "relative" or "absolute"
Background information for this bug: IE7 Z-Index issue - Context Menu
A solution specifically for your case and the exact way you have your page at the moment:
On #header-bar, add z-index: 9999 (or whatever number, I just picked that for convenience)
On #mainpage, add position: relative.
And here's a live version showing a version of the fixes in action, check it out with IE7:
http://jsbin.com/exuko6

z-index issue in ie7 with fixed header element and transparency

I've mocked up a page using 960.gs that has has several elements fixed in a div under which the content of the of the page is to flow. The background of this div is a CSS gradient, and has a height of 100% (if the gradient is applied to to the actual body of the page it doesn't actually extend the whole width of the page). As the user scrolls up, the content is to be viewable behind an opaque menu.
http://resume.jamesfishwick.com/
The layout works as I want in FF and Chrome, but the content of the page scrolls over the fixed upper area in IE7.
I understand that a new stacking context is being created, but I've been unable to resolve this by fiddling with the z-index of the elements in question, or their parents. I know I can consolidate some of the extra divs used by the grid, but I've been unable to do so in a way that keeps the gradient and transparency effects.
How can I achieve this look in IE7?
You will need to give that scrolling div a z-index which is less than the z-index on the main header. To control the transparency for msie 7 just add the following css code to the end of your document say right before the </body> tag.
/* ie6 hack */
* html .gradientLayer { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/path_to_images/mygradient.png', sizingMethod='scale')); }
/* ie7 hack */
*+ html .gradientLayer { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/path_to_images/mygradient.png', sizingMethod='scale')); }
In IE7 an element is trapped by its positioned parent and cannot escape. One cannot interweave the children of positioned parents because ie7 and 6 incorrectly apply a z-index of zero to positioned elements when they should have applied auto.
There is no way to escape this other than not positioning the parent which my case is not possible because I want it fixed.
So I'll need to change the design and apply the gradient to another element and not the 100% high fixed element. That will allow the header to be separate form the content and then the content can go under the header.

HTML and Body are not taking up the entire browser - HTML5 problem?

I have no idea what I'm doing wrong, but for some reason, I'm experiencing a bug with my markup that is causing my body element and my html element to not take up the entire viewport in the browser.
I can't get to the bottom of this. It first reared its head when I tried to add a 10px purple border to the top and bottom of my body.
If you inspect the page in Firebug, you you can see that there's a huge chunk of the page that is not highlighted when you hover on the html element or the body element. And the border that I applied at the bottom is hanging up very far on the page.
Does anyone know why this is? Could it have to do with my using HTML5?
Here's the page in question:
http://electricorangecreative.com/test/index.html
And here are my style sheets:
http://electricorangecreative.com/test/reset.css
http://electricorangecreative.com/test/style.css
Use a sticky footer technique.
I've had a look at the current test page and it looks like the only outstanding issue is the vertical scrollbar still appearing without need to. Easiest fix for this is to simply remove any margin or padding you have on elements you've set to height:100%. The culprit I identified is div#wrapper. Take off the padding there and the issue is resolved (in FF at least - not tested on other browsers). Since the padding is added to the height you end up with an element that stretches over 100% vertically. Use margins on children instead of padding - should be fine!

CSS Position Absolute Z-Index Issue

I have a form that uses a div that is positions over some input elements. For some reason, those input elements are above the positioned div, even though the div has a high z-index. Really not sure why this is happening, as the input fields don't even use absolute positioning, so I would think they would never be on top of another element.
Example (Click into Person, Status or Residence field):
http://www.puc.edu/puc-life/funnybook/little-black-funnybook
It looks like you don't even need to set a high stacking order for the .item .answer selector, at least in the Gecko engine. Try removing the position and z-index and see if it's consistent x-browser?
Edit: Ah I forgot I had applied position:relative to the div.item element, can you try toggling that when it shows up and unset it when you hide it?
That or leave position:relative on all div.items through external CSS and toggle the z-index to be '2' when the stuff pops ups and back to auto when it's hidden.
z-index is the solution but it does not work proper with youtube movie iframe, for that you would have to use wmode='transparent'

Resources