Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. SVG
  3. リファレンス
  4. 要素
  5. <linearGradient>

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

<linearGradient>

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.

* Some parts of this feature may have varying levels of support.

<linearGradient>SVG の要素で、制作者が他の SVG 要素に適用する線形グラデーションを定義することができます。

html,body,svg {  height: 100%;}
html
<svg  viewBox="0 0 10 10"  xmlns="http://www.w3.org/2000/svg"  xmlns:xlink="http://www.w3.org/1999/xlink">  <defs>    <linearGradient gradientTransform="rotate(90)">      <stop offset="5%" stop-color="gold" />      <stop offset="95%" stop-color="red" />    </linearGradient>  </defs>  <!-- using my linear gradient -->  <circle cx="5" cy="5" r="4" fill="url('#myGradient')" /></svg>

属性

gradientUnits

この属性は、x1,x2,y1,y2 の各属性の座標系を定義します。値の型:userSpaceOnUse |objectBoundingBox;既定値:objectBoundingBox;アニメーション:

gradientTransform

この属性は、追加の座標変換をグラデーション座標系へ提供します。値の型:<transform-list>;既定値:等価変換;アニメーション:

href

この属性は、テンプレートとして使用する別の<linearGradient> 要素への参照を定義します。値の型:<URL>;既定値: none;アニメーション:

spreadMethod

この属性は、グラデーションがグラデーションを含む図形の境界の内側で始まったり終わったりする場合の振る舞いを示します。値の型:pad |reflect |repeat;既定値:pad;アニメーション:

x1

この属性は、線形グラデーションが描画されるベクトルグラデーションの開始点の x 座標を定義します。値の型:<length>;既定値:0%;アニメーション:

x2

この属性は、線形グラデーションが描画されるベクトルグラデーションの終了点の x 座標を定義します。値の型:<length>;既定値:100%;アニメーション:

xlink:href非推奨;

テンプレートとして使用する別の<linearGradient> 要素への<IRI> 参照です。値の型:<IRI>;既定値: none;アニメーション:

y1

この属性は、線形グラデーションが描画されるベクトルグラデーションの開始点の y 座標を定義します。値の型:<length>;既定値:0%;アニメーション:

y2

この属性は、線形グラデーションが描画されるベクトルグラデーションの終了点の y 座標を定義します。値の型:<length>;既定値:0%;アニメーション:

使用可能な場所

カテゴリーグラデーション要素
許可されている内容任意の数、任意の順序の以下の要素。
説明的要素
<animate><animateTransform><script><set><stop><style>

仕様書

Specification
Scalable Vector Graphics (SVG) 2
# LinearGradientElement

ブラウザーの互換性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp