<feDropShadow>

SVG の <feDropShadow> フィルタープリミティブは、入力画像のドロップシャドウを生成します。これは <filter> (en-US) 要素の中でのみ使用できます。

メモ: ドロップシャドウの色や不透明度は、 flood-color (en-US)flood-opacity (en-US) の各プレゼンテーション属性を使用することで変更できます。

<svg viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <filter id="shadow">
      <feDropShadow dx="0.2" dy="0.4" stdDeviation="0.2"/>
    </filter>
    <filter id="shadow2">
      <feDropShadow dx="0" dy="0" stdDeviation="0.5"
          flood-color="cyan"/>
    </filter>
    <filter id="shadow3">
      <feDropShadow dx="-0.8" dy="-0.8" stdDeviation="0"
          flood-color="pink" flood-opacity="0.5"/>
    </filter>
  </defs>

  <circle cx="5" cy="50%" r="4"
      style="fill:pink; filter:url(#shadow);"/>

  <circle cx="15" cy="50%" r="4"
      style="fill:pink; filter:url(#shadow2);"/>

  <circle cx="25" cy="50%" r="4"
      style="fill:pink; filter:url(#shadow3);"/>
</svg>

属性

dx

この属性は、ドロップシャドウの X 方向のオフセットを定義します。 値の型: <number>; 既定値: 2; Animatable: yes

dy (en-US)

この属性は、ドロップシャドウの Y 方向のオフセットを定義します。 値の型: <number>; 既定値: 2; Animatable: yes

stdDeviation (en-US)

この属性は、ドロップシャドウのぼかし操作の標準偏差を定義します。 値の型: <number>; 既定値: 2; Animatable: yes

グローバル属性

使用上の注意

カテゴリーフィルター構成要素
許可されている内容任意の数、任意の順序の以下の要素。
<animate><script><set>

仕様書

Specification
Filter Effects Module Level 1
# feDropShadowElement

ブラウザーの互換性

BCD tables only load in the browser