The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS “magic numbers” in CSS Re: “magic numbers” in CSS


One magic number that comes to mind for CSS would be zero, as in:

-webkit-transform: translateZ(0);

This is the cause of and solution to a number of problems in Webkit based browsers, especially Mobile Safari.

If you transform any elements at all in your code, you may need to apply this transformation to the parent element(s), too in order to increase performance and reduce flicker.

It can also be a way to get better performance when animating opacity.