A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/CSS/transform-function/matrix below:

matrix() - CSS: カスケーディングスタイルシート | MDN

matrix()

Baseline Widely available

matrix() は CSS の関数で、二次元同次変換行列を定義します。結果は <transform-function> データ型になります。

試してみましょう
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>

メモ: matrix(a, b, c, d, tx, ty) は matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1) の短縮形です。

構文

matrix() 関数は 6 つの値で指定されます。定数は内蔵されていて引数としては渡されず、その他の引数は列優先の順で記述されます。

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

<number> で、線形変換を記述します。

tx ty

<number> で、適用する変換を記述します。

値は次の関数を表します。 matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY())

例 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;
}
結果 仕様書 ブラウザーの互換性 関連情報

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