Jump to content

IE7 Relative positions over absolute


biggieuk

Recommended Posts

Hi all,

 

I am trying to do what is normally a simple task of positioning a 'position:absolute' div over a 'position:relative' div containing and img tag.

 

Here is a (amazingly drawn) sample of what it looks like in all modern browsers but IE7:

 

2lbe26t.png

 

In IE7 the green box for some reason is behind the big grey banner?

 

here is my css:

 

#green_box {
background:url(images/layout/business-card.png) no-repeat;
width:363px;
height:190px;
text-indent:-1000em; 
position:absolute;
margin:17px 0 0 29px;
z-index:999;
}


/**********  Feature Box **********/

#grey_container {
position:relative;
width:947px;
margin:34px auto 0 auto;
z-index: 0;
}


a.arrow_left {
position:absolute;
z-index:2;
left: 20px;
top: 89px;
width: 21px;
height: 38px;
text-decoration: none;
background:url(images/feature/arrow-left.png);
}

a.arrow_right {
position:absolute;
z-index:2;
right: 20px;
top: 89px;
width: 21px;
height: 38px;
text-decoration: none;
background:url(images/feature/arrow-right.png);
}

 

The grey box html is as follows:

 

<div id="grey_container">
            	<a href="#" class="arrow_left" title="Previous"></a>
                <a href="#" class="arrow_right" title="Next"></a>
           		<img src="images/feature/banner.jpg" height="214" width="947" alt="Banner" />
                <div id="navi"></div>
</div><!-- grey_container -->

 

Any ideas? Im going mad.

 

Thanks!

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.