<feDropShadow>

Baseline Widely available

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

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

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

html
<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

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

stdDeviation

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

グローバル属性

使用上の注意

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

仕様書

Specification
Filter Effects Module Level 1
# feDropShadowElement

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
feDropShadow
dx
dy
in
stdDeviation

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support