function

Matrix3d() — CSS reference

Defines a homogeneous 4×4 matrix in column-major order. The thirteenth through fifteenth entries here supply x, y and z translation. With no perspective the visual box moves by 30px and 20px.

Formal Syntax & Structure

css syntaxcss
matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,30,20,50,1)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>matrix3d()</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#scene{position:relative;margin:0;width:300px;height:300px}#a{width:100px;height:60px;padding:0;transform-origin:0 0;background:rgb(0,100,0);color:white}#b{width:100px;height:20px;background:rgb(40,80,180)}#a{transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,30,20,50,1)}</style><body><main id="scene"><div id="a">A</div><div id="b">B</div></main></body></html>
CSS Reference