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 950103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:30:45+00:00 2026-05-15T23:30:45+00:00

I am trying to get the z-index to work in my HTML code. I

  • 0

I am trying to get the z-index to work in my HTML code. I have looked this up at several places, and it says that I need to add a position to my div. I’ve already done this and it still isn’t working. Below is the CSS and the HTML that I used for the z-index.

CSS:

.Location{
    width: 1000px;
    margin-top: 50px;
    margin-left: auto;
    margin-bottom: 0px;
    margin-right: auto;
}

.logo{
     background-color: white;
     position: relative;
     left: 40px;
     float: left;
     width: 225px;
     z-index: 10;
     padding-left: 15px;
     padding-bottom: 20px;
     padding-top: 20px;
}
  • 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-15T23:30:46+00:00Added an answer on May 15, 2026 at 11:30 pm

    What you’ve got is correct to apply z-index: a position of type relative, fixed or absolute. The problem with IE is that it doesn’t apply the z-index of an element globally across the entire document as it does in other browsers.

    In IE, z-index is only applied within a stacking context, which is automatically created by any element that has position relative, fixed or absolute applied to it.

    As a result, you’ve most likely got the following, which is why z-index isn’t working as you’d expect:

    <div style="position: relative">
       <div style="position: relative; z-index: 1;">
       </div>
    </div>
    <div style="position: relative">
       <div style="position: relative; z-index: 2;">
       </div>
    </div>
    

    In the above, all browsers but IE will always put the z-index: 2 div above the z-index: 1. However, IE won’t always because both elements are in their own stacking context and therefor their z-index’s don’t apply to each other.

    The fix is to add z-index to the parent elements that are creating the separate stacking context:

    <div style="position: relative; z-index: 1;">
       <div style="position: relative;">
       </div>
    </div>
    <div style="position: relative; z-index: 2;">
       <div style="position: relative;">
       </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to get this code to work for hours! All I need
I have been trying to get this to work. Basically I have a search
I'm trying to add an image to a generated html word document that is
I've spent too much time trying to get this to work on IE 7.
I'm trying to get my ad hoc build distributed but have started experiencing problems.
I'm trying to get the clicked tab to be 'Selected'. I have a class='selected'
What I'm trying to do:- Index page would have a dropdown of say categories,
I have the following code: $(document).ready(function() { var id = 'cbx'; var idPrefix =
I have a standard User controller with the normal set of actions (index, show,
I am trying to formulate a work-around for the lack of a checkbox group

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.