Unit of length
IE and Firefox require a unit of length on perspective
values (px
, em
).
-moz-perspective: 800px;
perspective: 800px;
For Chrome and Safari, the unit of length is optional when using the -webkit
prefix.
-webkit-perspective: 800; /* This works with or without the px unit */
W3C standards
It's safer to add a unit of length to all perspective
values. It's more consistent with the W3C standard. It's the one approach that all browsers support. And once Chrome and Safari start supporting perspective
without a prefix, it's possible that they'll require a unit of length (for consistency with W3C standards and with other browsers).
-webkit-perspective: 800px;
-moz-perspective: 800px;
perspective: 800px;
Note: The current info on w3schools.com is outdated. There's no mention of support for IE10 or Firefox, and their examples do not have a unit of length. The more-recent examples on developer.mozilla.org include a unit of length, consistent with the W3C standards.