A Web Design Community curated by Chris Coyier

#40: How z-index Works

By: Chris Coyier on: 11/3/2008 with 9 Comments

Z-index can be a little confusing sometimes. In this screencast I attempt to explain how it works, how it’s tied to positioning, some quirks, and some general advice.

Running time: 19 minutes

Direct Download: High Quality, Quicktime .M4V Format (AppleTV Ready)

Get the Flash Player to see this player.

9 Responses

  1. Toni L says:

    If static element won’t do z-index, does it mean, that it kinda has z-index-value of zero through the line.

  2. Gfx-Dzine says:

    Thanks for the info! Very usefull.

    Mike.

  3. Alen says:

    Thanks for the great tips. Just got a quick question if anyone knows using the z-index can i place any div element with a higher z-index over a flash movie. I know Chris mentions about drop down menus somtimes getting lost under flash. But is it simply a matter of creating a div element for the flash and another div element for the page element you want to layer on top of the flash movie and setting the position to either absolute or relative and setting the z-index to a higher value?

    will this work?

  4. Alex Wind says:

    how do you get IE 7 on your mac?

  5. Nile says:

    Or you could just #badge:

    z-index: -1;

  6. carlnunes says:

    I love how I can nav to css-tricks.com and search for “z-index” and get the info I need to get the job done right!
    Thanks again!

  7. ivan says:

    Hello,
    First, i would thank you for the lessons on this site.
    Is it possible to give a lesson about positioning in css.
    I am a beginning webdesigner and i have some problems with positioning in css, espacially between the different browsers.

    Thank you,
    Ivan

This comment thread is closed. If you have important information to share, you can always contact me.

* This website may or may not contain any actual CSS or Tricks.