Tiffany B. Brown, Opera Software
transform:none
versus
transform: translate(100px,100px);
transform-origin
propertySpecifies the x and y position of the origin, relative to the transform object.
left
, right
, bottom
, top
, center
transform-origin: 50px 70px
transform-origin: x y
perspective-origin
propertySets a horizon point at the given coordinates on the parent element. Changes the perceived vantage point at which the user appears to be looking at child elements.
left
, right
, bottom
, top
, center
transform
propertyWhich transform or transforms to apply.
transform: function();
transform: function() function();
A mathematical function that alters an object while preserving the algebraic or geometric structure. Often expressed as a matrix.
Coordinate vector × Transform matrix = Transformed coordinates
Function | Vector |
---|---|
scale3d | [sx 0 0 0 0 sy 0 0 0 0 sz 0 0 0 0 1] |
translate | [1 0 0 1 tx ty] |
rotate | [cos(a) sin(a) -sin(a) cos(a) 0 0] |
skew (x-axis) | [1 0 tan(a) 1 0 0] |
skew (y-axis) | [1 tan(a) 0 1 0 0] |
Partial list. Sources: SVG and CSS Transforms specifications.
transform: matrix3d(sx,0,0,0,0,sy,0,0,0,0,sz,0,0,0,0,1);
transform: matrix(1,0,0,1,tx,ty);
transform: matrix(1,0,tan(a),1,0,0);
transform: matrix(1,tan(a),0,1,0,0);
transform: matrix(cos(a),-sin(a),tan(a),0,1,0,0);
matrix(a,b,c,d,e,f)
rotate(ang)
translate(tx[,ty])
translateX(tx)
translateY(ty)
scale(sx[,sy])
scaleX(sx)
scaleY(sy)
skewX(ang)
skewY(ang)
matrix3d(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
translate3d(tx, ty, tz)
translateZ(tz)
scale3d(n,n,n)
scaleZ(n)
rotate3d(n, n, n, ang)
rotateX(ang)
rotateY(ang)
rotateZ(ang)
perspective(len)
backface-visibility
transform-style
transform-origin
perspective
perspective()
function)backface-visibility
hidden
or visible
transform-style
flat
or preserve-3d
perspective
Applied to parent element. Smaller = closer; larger = farther
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis accumsan faucibus tortor id porta. Sed imperdiet, tortor vitae viverra vestibulum, diam lorem fermentum mauris, quis bibendum erat dolor non ante. Quisque quis augue ut purus feugiat semper sit amet sit amet mauris. Integer commodo ligula id velit blandit eget dictum sem fringilla. Nullam dolor dui, laoreet eget hendrerit a, fermentum id libero.
Morbi posuere condimentum leo, ut venenatis enim semper aliquet. Nunc rutrum varius iaculis. Quisque adipiscing mollis est. Nunc est nisl, fermentum non scelerisque id, vulputate id urna. Mauris eget quam vel eros molestie iaculis. Sed vulputate blandit dui ut mollis. Curabitur consectetur placerat odio in porta. Proin tempor, libero in ultrices venenatis, lacus turpis euismod leo, a placerat nisi nisl vitae odio.
Etiam eget neque diam. Donec eget ligula vel turpis aliquet dignissim sit amet sed magna. Aenean a metus congue nunc tempus elementum sit amet sit amet mi. In hac habitasse platea dictumst. Cras molestie tempor erat, ultricies placerat neque fringilla in. Fusce tincidunt elementum massa a hendrerit.
Nullam mollis nisl et est molestie quis lacinia leo imperdiet. Vestibulum faucibus varius velit, in pretium sem consequat et. Mauris pharetra dui quis tortor ultricies et convallis purus tincidunt. Curabitur ullamcorper vehicula ultrices. Vestibulum elit leo, fermentum rutrum convallis quis, gravida imperdiet risus.
Fixed / absolute positioned children are offset from the parent, not the root element.