Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the inclusion of z-index increase browser processing times?

I am developing a thoroughly CSS-based website which necessitates the usage of z-index several times, ranging in value from -10000 to the upwards of 50000.

Does the usage of z-indexmeasurably increase the amount of time a supported browser takes the render the webpage? Is z-index considered a good practice or are there other alternatives which are either (1) faster to render and/or (2) more generally acceptable?

like image 826
Andy Dwyer Avatar asked Dec 20 '12 08:12

Andy Dwyer


1 Answers

Z-index are relative, not absolute. An element with z-index 1,000,000 renders in front of elements with lower z-index and behind elements with higher z-index. If does not mean that the browser will create 1,000,000 layers.

I think it is the number of distinct z-indexes (stacking contexts to be more precise) that matters.

like image 65
Salman A Avatar answered Sep 22 '22 21:09

Salman A