[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/CSS/Reference/Values/transform-function/matrix [Back]  [Original]

CSS matrix() - CSS | MDN

MDN Web Docs

View in English Always switch to English

CSS matrix()

Baseline

20157

matrix() CSS <transform-function>

: matrix(a, b, c, d, tx, ty) matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1)

transform: matrix(1.2, 0.2, -1, 0.9, 0, 20);
transform: matrix(0.4, 0, 0.5, 1.2, 60, 10);
transform: matrix(0, 1, 1, 0, 0, 0);
transform: matrix(0.1, 1, -0.3, 1, 0, 0);
<section id="default-example">
  <img
    class="transition-all"
    id="example-element"
    src="/shared-assets/images/examples/firefox-logo.svg"
    width="200" />
</section>

css
matrix(a, b, c, d, tx, ty)

matrix() 6

a b c d

<number>

tx ty

<number>

(^2) (^2) (^3) (^3)
(acbd)\begin{pmatrix} a & c \\ b & d \end{pmatrix} (actxbdty001)\left( \begin{array}{ccc} a & c & tx \\ b & d & ty \\ 0 & 0 & 1 \\ \end{array} \right) (actxbdty001)\left( \begin{array}{ccc} a & c & tx \\ b & d & ty \\ 0 & 0 & 1 \\ \end{array} \right) (ac0txbd0ty00100001)\left( \begin{array}{cccc} a & c & 0 & tx \\ b & d & 0 & ty \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} \right)
[a b c d tx ty]

matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY())

<matrix()> = 
matrix( <number>#{6} )
CSS Transforms Module Level 1

HTML

html
<div></div>
<div class="changed"></div>

CSS

css
div {
  width: 80px;
  height: 80px;
  background-color: skyblue;
}

.changed {
  transform: matrix(1, 2, -1, 1, 80, 80);
  background-color: pink;
}

CSS Transforms Module Level 1
# funcdef-transform-matrix


Web Proxy Viewer  |  New URL  |  Original Page