Forum Moderators: not2easy
<body>
<div id="wrapper">
<img id="IMAGE 1" src="blahblah" height"blah blah../>
<div id="BANNER">
<img blah blah...../>
<h1>heading</h1>
</div>
</div>
</body>
my css is...:
#IMAGE 1 {
position: absolute;
top: 0;
left: 0;
width: 810px;
height: 40px;
z-index: 5;
}
#BANNER {
position: absolute;
top: 0;
left: 2px;
margin: 0 auto 0 auto;
border-bottom: 1px solid black;
background : url(banner_bg_01.gif) repeat-x;
height : 140px;
width: 801px;
z-index: 1;
}
The problem I am having is that I can control the z-index of the BANNER, but for some reason I cant control the z-index of the IMAGE 1?
I have tried placing the image in the BANNER element but that does nothing, and also see that somonelse says you cant give a child element a z-index to place over or beneath its parent, which makes sense.
But i do not have any control over the z-index of the image no matter where i put it? any ideas?
I also don't see the point of having your banner absolutely positioned. Whenever possible, it's best to keep things non-specially positioned.
You won't even need to assign either a z-index when you do it like that (since absolute always displays over static). Even if they were both absolutely positioned, the last/most recent element in the code will be the one that appears on top, so you still wouldn't need a z-index.
[edited by: Xapti at 4:50 am (utc) on Dec. 3, 2007]
also do you know how to get alpha transparency to apear in IE? I have used this:
<span id="topfade" style="width:900px;height:40px;display:inline-block;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='page_fade_top.png');
"><img style="
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
" src="page_fade_top.png" width="900" height="40" border="0" alt=""></span>
with the css of :
#logo img, #topfade img {
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);
}
#logo, #topfade {
display: inline-block;
}
#topfade {
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='page_fade_top.png');
}
But when i browse the page in IE it blocks the effect. It only shows the effect when I click accept, but I dont really want it to block it in the first place as people might think the site is dogdy?
[edited by: Xapti at 6:51 am (utc) on Dec. 4, 2007]
I have tried using absolute and relative positioning on the #topfade but it still shows underneath everything. I did include heights and widths when doing this.
I no you said earlier to remove the positioning on the banner, but i think i need this to place the navigation correctly, unless im doing this wrong as well?
UPDATE: sorry to have wasted your time. I have finally cracked it after much deleting and editing. WOHOO!
Thanks 4 all your help.