background-clip

このエントリーをはてなブックマークに追加

background-clipはCSS3で追加されたプロパティで背景の描画の範囲を指定できます。

指定できる値は次のもので、デフォルトではborder-boxが採用されます。

border-box borderとborderの内側
padding-box paddingとpaddingの内側
content-box paddingの内側
.target{
	background-image:url("aaa.jpg");
	background-clip:content-box;
}

複数の背景に対して個別に指定したい場合は,(カンマ)区切りで指定を行ないます。
(ただし、この記述はIE8以下ではサポートされていません)

.target{
	background-image:url("aaa.jpg"),url("bbb.jpg");
	background-clip:content-box,border-box;
}

参考URL

3.7. Painting Area: the ‘background-clip’ property - W3C

登録日 : 2014年01月11日 最終更新日 : 2014年1月11日

同じカテゴリー(Background)のエントリー

検索

スポンサードリンク

バージョン

リファレンス