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

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

View in English Always switch to English

<feDropShadow>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2020年1月⁩.

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

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

他のフィルタープリミティブと同様に、既定では色成分を linearRGB 色空間で処理します。 color-interpolation-filters を使用すると、代わりに sRGB を使用することができます。

html,
body,
svg {
 height: 100%;
}
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; アニメーション:

dy

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

stdDeviation

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

使用コンテキスト

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

仕様書

Specification
Filter Effects Module Level 1
# feDropShadowElement

ブラウザーの互換性

関連情報

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /