--- title: mask-image slug: Web/CSS/mask-image tags: - CSS - CSS プロパティ - CSS マスク - Experimental - Reference translation_of: Web/CSS/mask-image --- <div>{{CSSRef}}</div> <p><strong><code>mask-image</code></strong> は <a href="/ja/docs/Web/CSS">CSS</a> のプロパティで、要素のマスクレイヤーとして使用される画像を設定します。</p> <pre class="brush:css no-line-numbers">/* キーワード値 */ mask-image: none; /* <mask-source> 値 */ mask-image: url(masks.svg#mask1); /* <image> 値 */ mask-image: linear-gradient(rgba(0, 0, 0, 1.0), transparent); mask-image: image(url(mask.png), skyblue); /* 複数の値 */ mask-image: image(url(mask.png), skyblue), linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* グローバル値 */ mask-image: inherit; mask-image: initial; mask-image: unset; </pre> <p>{{cssinfo}}</p> <h2 id="Syntax" name="Syntax">構文</h2> <h3 id="Values" name="Values">値</h3> <dl> <dt><code>none</code></dt> <dd>このキーワードは、透明な黒い画像レイヤーとして解釈されます。</dd> <dt><code><mask-source></code></dt> <dd>{{cssxref("<url>")}} による {{SVGElement("mask")}} または CSS 画像への参照です。</dd> <dt>{{cssxref("<image>")}}</dt> <dd>マスク画像レイヤーとして使用有れる画像の値です。</dd> </dl> <h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3> {{csssyntax}} <h2 id="Example" name="Example">例</h2> <h3 id="CSS">CSS</h3> <pre class="brush: css">#masked { width: 100px; height: 100px; background-color: #8cffa0; -webkit-mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); }</pre> <h3 id="HTML">HTML</h3> <pre class="brush: html"><div id="masked"></div> </pre> <p>{{EmbedLiveSample('Example', '100px', '100px', '', '', 'hide-codepen-jsfiddle')}}</p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("CSS Masks", "#the-mask-image", "mask-image")}}</td> <td>{{Spec2("CSS Masks")}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("css.properties.mask-image")}}</p>