background-image

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

background-imageプロパティは要素に背景画像を設定できるプロパティです。

初期値は「none」ですがurl()を利用して任意の画象が指定できます。

.target{
	background-url:url(background.png);
}

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

.target{
	background-url:url(background01.png),url(background02.png);
}

背景画像はbackground-colorで上の、border、paddingを含んだコンテンツの左上を基準に配置されmargin領域には描画されませんが、background-clipプロパティで調整もできます。

参考URL

3.3. Image Sources: the ‘background-image’ property - W3C

登録日 : 2013年12月24日 最終更新日 : 2014年1月11日

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

検索

スポンサードリンク

バージョン

リファレンス