CKTIS / CSS
scale3d(): independent scales for three axes
Change the X, Y and Z scale independently without recalculating the element’s layout size.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
transform: scale3d(2, 3, 4);scale3d(sx, sy, sz) multiplies coordinates along three axes. All three comma-separated arguments are required. A factor of 1 leaves its axis unchanged; a negative factor reflects that axis. Percentages represent factors, so 50% means 0.5 rather than half of a parent’s dimensions. Lengths such as 2px are not scale factors.
The element is still a flat plane, not a solid with thickness. Scaling Z alone cannot make its unrotated z=0 surface wider or taller. The Z factor matters for points displaced in depth and for compositions with rotations, translations or perspective. The transform-origin sets the reference point; function order changes the composed result.
The example transforms a 40×30px box with factors 2,3,4. Its visible rectangle is 80×90px while offsetWidth and offsetHeight remain 40×30. The computed matrix maps the point (1,2,5) to (2,6,20). The percentage form yields diagonal factors 0.5,1,1.5, and the incomplete two-argument form is rejected.
Examples
const box=document.createElement('div');
box.style.cssText='position:fixed;left:60px;top:60px;width:40px;height:30px;transform-origin:0 0;transform:scale3d(2,3,4)';
document.body.append(box);
const rect=box.getBoundingClientRect();
const matrix=new DOMMatrix(getComputedStyle(box).transform);
const point=matrix.transformPoint(new DOMPoint(1,2,5));
box.style.transform='scale3d(50%,100%,150%)';
const percentages=new DOMMatrix(getComputedStyle(box).transform);
console.log('rendered='+rect.width+'x'+rect.height+'; layout='+box.offsetWidth+'x'+box.offsetHeight+'; point='+[point.x,point.y,point.z]+'; percentages='+[percentages.m11,percentages.m22,percentages.m33]+'; missing-z='+CSS.supports('transform','scale3d(2,3)'));Result
rendered=80x90; layout=40x30; point=2,6,20; percentages=0.5,1,1.5; missing-z=false
Rendered dimensions and layout dimensions answer different questions. The third coordinate is checked through the computed matrix; the example does not pretend that the box has physical thickness.