Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6066691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:31:40+00:00 2026-05-23T09:31:40+00:00

This is my example code which is not working as expected in IE7 –

  • 0

This is my example code which is not working as expected in IE7 – I think position:relative; is the issue for IE7

.oner {
  position:relative;
  height:50px;
  background:#fff;
  border:5px solid #e4e4e4;
  height:200px;
  margin-top:20px;
}

.onea {
  position:absolute;
  height:500px;
  right:0;
  width:200px;
  background: #eee; 
  z-index:999;
}

.onet {
  position:absolute;
  height:500px;
  left:0;
  width:200px;
  background:red; 
  z-index:999;
}

HTML:

<div style="height:500px;width:900px;margin:auto;">
    <div class="oner">
        <div class="onea">IE IE7 this div goes behind the "oner" div below </div>
    </div>
    <div class="oner">
        <div class="onet">My name is Sumit Kumar Ray my email is ..</div>
    </div>
</div>

What happens is that the onea div goes behind the following oner div, but in other browsers it overlays it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:31:40+00:00Added an answer on May 23, 2026 at 9:31 am

    setting a z-index on a div is actually supposed to create a stacking context, not simply bring the div, it’s applied to, above another.. so while I do think IE7 didn’t get it quite right, (surprise!)

    I think it would be better to make the oner divs the ones that create the start of the stack by setting the z-index on them, and what you want it for the first oner to have a higher z-index than the second

    <div style="height:500px;width:900px;margin:auto;">
        <div class="oner" style="z-index: 1;">
            <div class="onea">IE IE7 this div goes behind the "oner" div below </div>
        </div>
        <div class="oner">
            <div class="onet">My name is Sumit Kumar Ray my email is ..</div>
        </div>
    </div>
    

    with this there is no need for the Absolutely Positioned children to have a z-index at all, as those divs now take their “z level” from their relatively positioned parent – IE and the stack can be quite confusing!

    CSS:

    .oner {
      position:relative;
      height:50px;
      background:#fff;
      border:5px solid #e4e4e4;
      height:200px;
      margin-top:20px;
    }
    
    .onea {
      position:absolute;
      height:500px;
      right:0;
      width:200px;
      background: #eee; 
    }
    
    .onet {
      position:absolute;
      height:500px;
      left:0;
      width:200px;
      background:red; 
    }
    

    However it does mean that if you have more than two as in this example you need to set the levels on all the oner divs with the first one being the highest.. (that’s why I put the oner style inline in the HTML if you have more you might need some more classes to separate them)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take this example code (ignore it being horribly inefficient for the moment) let listToString
There is this example code, but then it starts talking about millisecond / nanosecond
take a look at this example code: public class Comment { private Comment() {
The questions says everything, take this example code: <ul id=css-id> <li> <something:CustomControl ID=SomeThingElse runat=server
for example this code var html = <p>This text is <a href=#> good</a></p>; var
Has anyone done this / have some example code?
I would like to see how this example of existing code would be able
Many C++ books contain example code like this... std::cout << Test line << std::endl;
I see a lot of example code for C# classes that does this: public
I am curious to know why this is happening. Please read the code example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.