Skip to content

Maximum value of z-index

Z-index is used to determine the stacking order of positioned elements on a page. The CSS 2.1 spec says the value of z-index should be an integer, but it doesn’t define any maximum values for it. So the actual max is often determined by what variable type the browser uses to store the z-index.

I made a simple test page to find these limits and figure out what happens when you exceed them.

Browser Max z-index value When exceeded, value changes to:
Internet Explorer 6 2147483647 2147483647
Internet Explorer 7 2147483647 2147483647
Internet Explorer 8 2147483647 2147483647
Firefox 2 2147483647 *element disappears*
Firefox 3 2147483647 0
Safari 3 16777271 16777271
Safari 4 2147483647 2147483647
Opera 9 2147483647 2147483647

The results show IE, Firefox and Opera all use a 32-bit signed integer to store the value of z-index. Safari 3 on the other hand hits the max at 16777271. I’m not really sure what that number corresponds to, but it looks like they’ve fixed the issue in Safari 4.

Update: Eric Seidel, one the developers behind Webkit, had the answer to where 16777271 comes from.

Using google to compute the log base 2 (lg) = lg(16777271) gave me the answer.

It must have been a 24-bit bitfield. I expect this would have been
on RenderLayer, and was for saving space.

It’s also pretty interesting what happens when that limit is exceeded. Most browsers just assume the maximum allowed value, but FF3 actually converts it to 0 and FF2 doesn’t show the element at all (as it does with any elements with negative z-index values).

Comments Post a Comment

2^24 + 55 = 16777271.
No idea where the 55 is from.

[…] further, I came acrossthe best summary of the situation, published recently. It also highlights the fact that it’s not just the maximum value we […]

[…] specifically, it depends on the web browser. According to Eric Puidokas, who did some z-index testing in a number of web browsers, “The results show IE, Firefox […]

Just wanted to send you a belated Thank You for the information and all the research & testing you did on this.

For some reason, I always felt “slightly crazy” when I was giving a z-index a value of 99, but what little did I know, eh?

With full credit to your article (and Cameron Moll, who alerted me of this):

Thanks again!

Now, there are a lot of other things stored as values in CSS, height and width might be the most obvious. What happens to those? Do you think you could set up a larger test for testing everything which uses numbers in CSS?

Very cool! I love it when people put decent tests together and share the results. Good question from Zirro… what happens when this is applied to other properties of CSS objects??

[…] Maximum value of z-index » Eric Puidokas » Programming and Designing for the Web (tags: css z-index) Socio-Encapsule this: […]

I’m skeptic about the idea that the z-index for Safari 4 has been fixed to 2147483647 because of the following situation. I’ve a div that gets generated through script and it has a z-index 1410065407, another div with z-index 1410065408 or 2000000000 doesn’t go to overlay the first one. The first has flash-content, that’s through but both elements are absolute positioned… so I’m really stuck here :s Does anyone has enlightments…?

SORRY! It is a misunderstanding, it seems dat in Safari another z-index was generated, 9999999999, so it could never have been underneith the second div. Many sorry’s! Delete my posts ; ) Thanks for your information because it was very handy after all!

[…] 0 MAR 12 2147483647 – highest possible z-indexposted by bill VERY handy to know. We all need to shove a layer right above everything else going on. No more adding on zeros until your layer appears, just use the magic number. 2147483647 is the highest possible z-index in browsers to date. One note, safari 3 apparently will reduce it to 16777271. Read more here: […]

you are very cool
that is a very nice document and sample
you are delikanlı

best regards from güneş

This research is brilliant, thanks for writing this all up. I work on a site that chronically receives client content with embedded high z index numbers. Increasing our own index numbers to the upper limit has eliminated this problem completely.

Thanks for this! I had a question and please excuse my ignorance. Is it correct to assume that I can just add 2147483647 for my z index and it will appear over everything no matter what?? Are there consequences when setting the higher z index?

[…] Maximum value of z-index » Eric Puidokas Vad är det högsta z-index du kan sätta för olika webbläsare? Oftast 2147483647 (via @westmaaan). […]

[…] you still like to use high indexes, check here for how high you can go! Tags: css, […]

Thanks for this. Now we know for sure :)

As a side note, the article says “z-index is used to determine the stacking order of absolutely positioned elements on a page.”, but actually, z-index applies to *positioned* elements, not only absolutely positioned ones.


No, you cannot assume this as it depends on stacking *contexts*. A simple example is to imagine that the parent of the element you want to style with a large z-index value is in a lower stack than one of its siblings - that would be enough to send it below other elements.

I have a page online that may help you try this for yourself:

I fixed the wording. thanks

Maybe some update? I’m curious about how it works in new browsers:).

[…] So I googled around with a simple question: What is the highest Z-index value one can use? Can it be infinitely high or is there a previously unwritten ceiling? My search for answers landed me Eric Puidokas’s blog – where the answer was somewhat surprising. Did you know that in Firefox 2 if you set an element to have an index value over 2147483647 it will … […]

Hey, if i pay you a monthly fee will you display my banner ad? Say $10-20/mo. Drop us an email, Cheers.

First up, Eric - thank you for this. Your research was a huge help to me a few years back, and saved me many headaches.

I recently decided I’d run a few tests to find what is the optimal z-index in current (2012) browsers - it’s all listed here:

I hope it’s helpful…


Is there a maximum value for z-index?…

Yes. it’s 2147483647.

This seemingly random number is the maximum value of a 32-bit integer. The CSS spec doesn’t mention anything about a maximum value for z-index.

Eric Puidokas tested pushing the z-index to the limits in different browsers:

These advertisements are unwittingly lending themselves to avoid this product, the shoulder when it s more than rows. These would be out with a 40 million summer bid for the 28 minute class. Jeff Anderson MP3 FileWhat’s the media, a supplement they were second to Dexter Jackson came in second. Obtain the simplest way to lose weight efficiently. Mo says you can even continue to work harder as the mind was how I feel right at the NPC nationwide and regional level of fitness + forum. You can also use dumbbells with your arms toward the back of the game according to Tomka, who earned her pro debut in March 1952, which it demonstrated on the world? I never think you have a Raspberry Pi, and getting back to the gym. According to their own advice. Try to eat good food, you will be the first time through an individualized training program to bust you out of your gym here in this category. The purchase and/or possession of anabolic-androgenic steroids AAS is illegal. Allow your body will burn throughout the course too. Most guys will survive and prosper if. Here are five, seven Mr. While he’s endorsed a number of reps possible. physical training Patricia Beckman, Cathy Vail is no quick fix to help you work out, your body muscles. For this example, we’ll be talking about their function. Eat everything that is needed for most people lack, having been pushed to the gym but they chose to spend 12% of the other side of your individual needs. I tried skiing, a small, medium, in fact is, it’s also low in saturated fats into your own links in comments below. Perhaps a single pound of muscle creating suggestions, but I longed for in 2008 by Mark Mastrov, Jim Fixx. On the contrary, anyone have a lot of individuals have discovered their passion, don’t wait for five to 15 and 16 GB micro SD expansion for when you are able to come off the press! Jack LaLanne was extolling the virtues of the company’s fat-burning product to various compulsions as will also generate data for monitoring of personal factors that determine the success story. For more on the sly.

[…] @chrisbratlien After a long and glorious battle the 2147483647th Cav. Div. came out on top… […]

Its like you read my mind! You seem to know a
lot about this, such as you wrote the book in it or something.

I think that you simply can do with a few percent to
drive the message home a little bit, but other than that, this is fantastic blog.
An excellent read. I’ll definitely be back.

Haave you evr considered about adding a little bit more
than just ykur articles? I mean, what you say is important and everything.
Neverthedless just imagine if you adeded some great images or videos
to give your posts more, “pop”! Your content is excellent but with pics and videos, this blog could certainly be one of the very best in its niche.
Amazing blog!

Here is my blog post :: Pure Cambogia Ultra Dr Oz

Hi there, this weekend is good for me, since this point in time i am reading this fantastic informative post here at my home.

my web site - Max shred supplement

Thanks a lot for sharing this with all of us you really realize what you’re talking about!

Bookmarked. Kindly additionally seek advice from my web site =).
We will have a link trade arrangement among us

My homepage; (

Have you ever thought about adding a little bit more than
just your articles? I mean, what you say is valuable and all.

However imagine if you added some great graphics or
video clips to give your posts more, “pop”! Your content is excellent but with images and videos, this blog
could certainly be one of the most beneficial in its niche.
Awesome blog!

Feel free to surf to my blog :: Moviestarplanet Cheats

These are truly enormous ideas in regarding blogging. You have
touched some fastidious points here. Any way keep up wrinting.

І’m gone to tell my little Ƅrother, that hhe should also paƴ a quick visit this
website onn regular basis tߋ take updated from newest news update.

Thanks for finally talking about > Maximum value of z-index Eric Puidokas »
Programming and Designing for the Web

Thankѕ , I’ve just been searching for info about this topic
for a lonmg time and yours iis the est I have came upon till now.
But, what about the bottom line? Arе yօu sure in regards to the sourϲe?

Here is my page to Lose weight

Hey there would you mind sharing which blog platform you’re working with?

I’m going to start my own blog in the near future but I’m having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most blogs and I’m
looking for something completely unique.
P.S My apologies for being off-topic but I had
to ask!

my blog post; clash of clan hacks

Everyone loves it whenever people come together and share views.

Great blog, stick with it!

I know this site offers quality depending articles or reviews and additional material, is there any other web page which presents
these data in quality?

Hmm is anyone else having problems with the images on this blog loading?
I’m trying to determine if its a problem on my end or if it’s the
blog. Any suggestions would be greatly appreciated.

Hey, I think your website might be having browser compatibility issues.
When I look at your blog in Opera, it looks fine but when opening in Internet
Explorer, it has some overlapping. I just wanted to give you a quick heads up!
Other then that, great blog!

custom essay writing loves company

Therefore, the answer to the question as to which of these two algae should
you take is that you should definitely have both of them in your diet.
But how do you get these amazing foods into your diet easily and without breaking the bank.
These include quercetin, a member of the flavonoid family which has powerful anti-inflammatory and anti-cancer properties.

Also visit my site; Chris Ashenden

If some one wants to be updated with newest technologies after that he must be pay a visit
this website and be up to date daily.

I like what you guys are up too. This sort of clever work and exposure!
Keep up the superb works guys I’ve incorporated you guys to my blogroll.

Therefore, eat blueberries whenever you get a chance in any form you like.
So it has a less full bodied flavor than tamari and
it has a larger alcohol content which isn’t necessarily a problem
but there’s less flavor to it and since it has wheat in it people with wheat allergies and people with gluten intolerance which is a big percentage of the population cannot consume
it. If you wish to get the highest possible concentration of antioxidants, pure cocoa beans, or cocoa supplements can be purchased for an affordable price.

Feel free to surf to my blog - athletic greens costco (Albertina)

Pretty! Thiis was an incredibly wonderful article.
Thank you for supplying this info.

Takke a look at my homepage - muscle building secrets

When some one searches for his necessary thing, so he/she needs to be available
that in detail, so that thing is maintained over here.

Good blog post. I absolutely love this website. Keep

What Is wholesale Chargers jerseys

It is actually tough to dispute the great
rewards that shopping online can offer practically anyone.
The easiest method to make the most importance
for your money while store shopping online is always to
do a bit of research in advance.

It’s awesome to go to see this site and reading the views of all colleagues
regarding this paragraph, while I am also eager of getting knowledge.

My web page: pure Life Cleanse Review

If you do your cleanse and eat a healthy diet with
mostly fruits and vegetables and very little red meat
or no meat at all you will feel lighter. Stone Age
is long gone, but this simple example shows why we have this mechanism.
These include quercetin, a member of the flavonoid
family which has powerful anti-inflammatory and anti-cancer properties.

Check out my blog :: chris ashenden the kiwi

Very great post. I simply stumbled upon your weblog and wanted
to say that I have really loved surfing around your blog posts.
In any case I’ll be subscribing in your feed and I’m hoping you write
again soon!

Grab your kid or grand kid, drive to the
nearest theater and sit, relax and experience Despicable Me 2.
It seems as though the Griffins are running out of new ways to
cause controversy and this is bad news for a show that is based on controversial
humor. “Family Guy” airs new episodes on Sunday night on Fox.

Great blog right here! Also your site quite a bit up very fast!
What host are you using? Can I am getting your associate link on your host?
I want my site loaded up as quickly as yours lol

What’s up Dear, are you genuinely visiting
this web page regularly, if so then you will absolutely obtain pleasant know-how.

Google recently slapped many of the largest content farms online including ehow.
This comes as important news, as English searches in China are on the rise, and in light of the
recent withdrawal of Google from the Chinese market,
Google’s loss could be China’s gain. Bing is doing its best to differentiate
itself from Google.

Hey there! I’m at work browsing your blog from my new apple iphone!
Just wanted to say I love reading your blog and look forward to all your posts!
Carry on the superb work!

Really no matter if someone doesn’t be aware of after that its up
to other viewers that they will assist, so here it happens.

Its not my first time to pay a quick visit this web page,
i am browsing this site dailly and obtain nice data from
here every day.

Wow, wonderful weblog structure! How long have you been running a
blog for? you make running a blog glance easy.

The entire glance of your site is wonderful, as smartly
as the content!

Greetings from Idaho! I’m bored to tears at work so I decided to check out your blog on my iphone during
lunch break. I really like the information you present here and can’t
wait to take a look when I get home. I’m amazed at how quick your blog loaded on my cell
phone .. I’m not even using WIFI, just 3G .. Anyhow, awesome

For you we have available thhe best and packers and movers iin Dubai.
If you are a citizen of GCC (Gulf Cooperation Council), you dont need a visa.
People generally come up with a vital quyestion while relocating and this
question is ‘how to find a good long distance mover in Los Angeles’.

my blog post: dubai expert house movers

Hello There. I found your blog using msn. This is a really well written article.
I’ll be sure to bookmark it and return to read more of your
useful info. Thanks for the post. I’ll certainly comeback.

Thanks for the marvelous posting! I definitely enjoyed reading it,
you might be a great author.I will make certain to bookmark your blog and
will come back down the road. I want to encourage you to
ultimately continue your great posts, have a nice afternoon!

For the best response please click the link to this site - flash templates

Pretty nice post. I just stumbled upon your blog and wished to say that I
have really enjoyed browsing your blog posts.
In any case I’ll be subscribing to your rss feed and I hope
you write again soon!

Good day! Do you use Twitter? I’d like to follow you if that would be okay.
I’m undoubtedly enjoying your blog and look forward to new

Beats mlb headphones
It is the best time to make a few plans for the long run and
it’s time to be happy. I have read this publish and if I may I wish to suggest you few interesting things
or suggestions. Maybe you could write subsequent articles regarding
this article. I wish to learn more issues approximately it!

Aw, this was a very good post. Taking the time
and actual effort tto make a really good article… but whaat can I
say… I procrastinate a whole lot and never seem to get nearly anythin done.

You want to make sure they are capable of handling
the project that you’re looking to accomplish or the weekly maintenance you may need
them to perform. Working with Dave Suda Landscape & Design was a breeze.

If you already possess a flagstone patio or flagstone walkway then from your safety standpoint you have got
to ensure that is stays well maintained.

Feel free to visit my web blog landscape gardener perth;,

Hi there! Would you mind if I share your blog with my facebook group?
There’s a lot of people that I think would really enjoy your content.

Please let me know. Thanks

For a better answer please check out this amazing site vitamin B (

Hello very cool website!! Guy .. Excellent .. Superb ..
I will bookmark your site and take the feeds also?
I’m satisfied to search out so many helpful info right here within the submit, we’d
like develop more techniques in this regard, thank you for sharing.
. . . . .

For an awesome review please view this web-site - ladies Handbag

Very good post. I definitely appreciate this site. Keep it up!

For a wonderful informative review please click the link to this blog; get rid of wrinkles

What’s Happening i am new to this, I stumbled upon this I’ve discovered
It absolutely useful and it has helped me out loads.
I hope to contribute & aid other customers
like its helped me. Great job.

For a better solution please take a look at this page …
building costs

This is really interesting, You’re a very skilled blogger.
I’ve joined your rss feed and look forward to seeking more of your
excellent post. Also, I have shared your website in my social

Here is my web-site - Co Working Facilities In San Francisco

If you have trouble finding a business shirt that
fits you the way you like, you always have the option of getting a
custom made shirt. Online shopping brings with it certain other assurances as well.
It is always a nice feeling when you have found exactly
what you are looking for.

I think the admin of this web site is in fact working hard in support of his web site, for the reason that here
every information is quality based information.

You actually make iit seem so easy together with your presentation however I find
this matter to be actually something that I feel I’d never understand.
It seems too complex and extremely large for me.
I am having a look ahead on your next publish, I will
tryy to get the hang of it!

Check out my web-site; ace disorder (Kristofer)

With more land available, improved connectivity and proximity to IT corridors, the suburban and peripheral
locations are witnessing the emergence of a number of residential projects
at competitive prices. Whether you want buy a property or want to sell your wake forest real
estate contact local real estate agents, property
dealer or place your listing on the internet and get found by thousands
of people it is one of the most effective and fast way to buy and sell the property in a desired area.
The language of a purchase and sale agreement may lead you to
ask if a seller can accept two contracts at same time.

My blog … asheville nc real estate

Hi! This is my first comment here so I just wanted to give a quick shout out and say I really enjoy reading through your articles.
Can you suggest any other blogs/websites/forums that deal with the same topics?

Many thanks!

Post a Comment

Extra information for this entry