A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/CSS/transform-function/matrix below:

matrix() - CSS | MDN

matrix()

Baseline Widely available

The matrix() CSS function defines a homogeneous 2D transformation matrix. Its result is a <transform-function> data type.

Note: The matrix(a, b, c, d, tx, ty) function is a shorthand for matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1).

Try it
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>
Syntax
matrix(a, b, c, d, tx, ty)
Values

The matrix() function is specified with six values. The constant values are implied and not passed as parameters; the other parameters are described in the column-major order.

a b c d

Are <number>s describing the linear transformation.

tx ty

Are <number>s describing the translation to apply.

Cartesian coordinates on ℝ^2 Homogeneous coordinates on ℝℙ^2 Cartesian coordinates on ℝ^3 Homogeneous coordinates on ℝℙ^3 ( a c b d ) \begin{pmatrix} a & c \\ b & d \end{pmatrix} ( a c tx b d ty 0 0 1 ) \left( \begin{array}{ccc} a & c & tx \\ b & d & ty \\ 0 & 0 & 1 \\ \end{array} \right) ( a c tx b d ty 0 0 1 ) \left( \begin{array}{ccc} a & c & tx \\ b & d & ty \\ 0 & 0 & 1 \\ \end{array} \right) ( a c 0 tx b d 0 ty 0 0 1 0 0 0 0 1 ) \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]

The values represent the following functions: matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY()).

Formal syntax
<matrix()> = 
matrix( <number>#{6} )
Examples HTML
<div>Normal</div>
<div class="changed">Changed</div>
CSS
div {
  width: 80px;
  height: 80px;
  background-color: skyblue;
}

.changed {
  transform: matrix(1, 2, -1, 1, 80, 80);
  background-color: pink;
}
Result Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4