CSSのbackground-clipプロパティ
例
要素内で背景をどこまで拡張するかを指定します。
div
{
border: 10px dotted black;
padding: 15px;
background:
lightblue;
background-clip:
padding-box;
}
定義と使用法
このbackground-clip
プロパティは、要素内で背景(色または画像)をどこまで拡張するかを定義します。
デフォルト値: | ボーダーボックス |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | object .style.backgroundClip = "content-box" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
background-clip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
CSS構文
background-clip: border-box|padding-box|content-box|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
border-box | Default value. The background extends behind the border | |
padding-box | The background extends to the inside edge of the border | |
content-box | The background extends to the edge of the content box | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSSの背景
HTML DOMリファレンス:backgroundClipプロパティ