CSS3 background プロパティ
完全な CSS3 リファレンス
例
div へ複数の画像(および、その位置)を設定します
element:
div
{
background:url(smiley.gif) top left no-repeat,
url(sqorange.gif) bottom left no-repeat,
url(sqgreen.gif) bottom right no-repeat;
} |
Try it yourself »
|
ブラウザ・サポート

background プロパティは、主要なすべてのブラウザがサポートします。
注: IE8以前は、1つの要素に複数の背景画像はサポートしていません。
定義と用法
background ショートハンド・プロパティは、1回の宣言ですべての背景プロパティを設定します。
設定できるプロパティは次の通りです: background-color、
background-position、background-size、background-repeat、background-origin、
background-clip、background-attachment および background-image
上記値のうちの1つが欠けても問題ありません。例えば、background:#ff0000 url(smiley.gif); との指定が可能です。
| デフォルト値: |
各個別のプロパティ参照 |
| 継承: |
no |
| バージョン: |
CSS1 + CSS3 の新プロパティ |
| JavaScript構文: |
object.style.background="red url(smiley.gif) top left
no-repeat" |
構文
| background: color position size
repeat origin clip attachment
image; |
関連ページ
CSS3 チュートリアル: CSS3 Backgrounds
完全な CSS3 リファレンス
|