--- url: "https://web.dev/articles/3d-css" titulek: "3D and CSS | Articles | web.dev" h1: "3D and CSS Stay organized with collections Save and categorize content based on your preferences." popis: "" jazyk: "en" kanonicka: "https://web.dev/articles/3d-css" drobecky: ["Articles", "3D and CSS"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 02:42:06" znaku: 5328 slov: 809 kodovani: "iso-8859-2" sha256: "6aa29f860a8c1489e01876ec4e4313a6b21ad654fa55119665743dec9aaedf0a" --- 3D and CSS Stay organized with collections Save and categorize content based on your preferences. Paul Kinlan Introduction For a long time 3D has been the preserve of desktop applications. Recently with the introduction of advanced smart-phones that have access to native GPU acceleration we have started to see 3D used nearly everywhere. Commonly, 3D is primarily used as a device for gaming or some advanced user interfaces. It wasn't until the introduction of Perspective transforms in WPF and Silverlight that a suitable model for applying 3D effects to user interface elements became a practical solution for application developers (after all 3D isn't exactly easy). The [CSS 3D Transform Model](http://www.w3.org/TR/css3-3d-transforms/) was introduced as a Draft specification in March 2009 to allow web developers to create interesting and compelling user interfaces that take advantage of 3D by allowing application authors to apply 3D perspective transformations to any visual DOM element. The CSS 3D Transformation Working Draft is a logical extension to the [CSS 2D Transformation Model](http://www.w3.org/TR/css3-2d-transforms), introducing some extra properties, including: perspectives, rotations and transforms in a 3D space. Never before have we been able build 3D interfaces so easily. These technologies have lowered the barrier to entry. No longer do you have to be a mathematical whizz to build 3d elements. It must be noted that the CSS 3D module is designed to help developers build rich and visually interesting applications, it is not designed to enable you to build immersive 3d worlds. Browser Support and Hardware Acceleration -webkit-perspective Browser Support 36 12 16 9 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/perspective) -webkit-transform-3d Browser Support 2 12 49 4 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@media/-webkit-transform-3d) The important piece of information to remember is that although a browser may "support" 3d, it may not be able to render 3D due to hardware and driver limitations. 3D scenes based on the DOM can be very computationally expensive and therefore browser vendors have decided rather than slow the browsers down with a pure software rendering solution, they instead will take advantage of GPU which might not be available on all platforms Feature Detection What about feature detection? I was hoping that you weren't going to ask! Developers have been using tools such as Modernizr to detect support for specific browser features and abilities. Whilst it is possible to detect the presence of support for 3D transformations, it is not possible to detect for the presence of hardware acceleration, and hardware acceleration is the key ingredient. Basic Sample There is nothing better than jumping straight in. In this sample we will apply a basic set of rotations of an arbitrary DOM element. We start by defining a perspective on the root element. `