www.webdeveloper.com
Results 1 to 7 of 7

Thread: z-index and div inside div

Hybrid View

  1. #1
    Join Date
    Feb 2011
    Posts
    90

    z-index and div inside div

    Hi if I have div inside div like this:
    Code:
    <div>
    <div>
    </div>
    </div>
    Now I want to give the internal div an higher z index so it will be in the front.
    I of course change the internal div position.
    When I tried to do it, it didn't work.
    The father div function as if it has an higher z-index, although it has lower z-index.


    Why is that and how can I fix it without talking out the internal div outside the div that wrap it.

  2. #2
    Join Date
    Mar 2006
    Location
    Discworld
    Posts
    75
    yo do realizes that some CSS will not work on Microsoft browsers, right?

  3. #3
    Join Date
    Dec 2005
    Posts
    2,984
    Quote Originally Posted by alexsts View Post
    yo do realizes that some CSS will not work on Microsoft browsers, right?
    That's a bald-faced lie. On the rare occasion tt may work differently but it still works.

    I assume, from your description that you meant this (just to illustrate a little more clearly):

    Code:
    <div id="parent">
      <div id="child">
      </div>
    </div>
    And your question is how to get the child to have a higher z-index than the parent?

    The answer is the child, by default, will always have a higher z-index (and therefore be painted on top of) the parent (and yes, this is the situation in all browers). Perhaps you meant something else?
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  4. #4
    Join Date
    Mar 2006
    Location
    Discworld
    Posts
    75
    Quote Originally Posted by aj_nsc View Post
    That's a bald-faced lie. On the rare occasion tt may work differently but it still works.
    If he uses CSS3 -- some elements of it will not work even in IE9 while working just fine on the rest of the browsers...
    So you are not exactly correct.

  5. #5
    Join Date
    Dec 2005
    Posts
    2,984
    Quote Originally Posted by alexsts View Post
    If he uses CSS3 -- some elements of it will not work even in IE9 while working just fine on the rest of the browsers...
    So you are not exactly correct.
    It's a z-index question!! Does z-index sound like CSS3 to you? Don't talk ridiculous semantics, why in the world would you respond to a legitimate CSS2.1 question with:

    "you know some CSS won't work in MS browsers, right?"
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  6. #6
    Join Date
    Feb 2011
    Posts
    90
    aj nsc's thanks, you are right.

  7. #7
    Join Date
    Mar 2006
    Location
    Discworld
    Posts
    75
    And since now you do know that -- can you post code in question to see where (and for what) exactly you want to use Z-index.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles