下塗りの色(背景色)。
名前 | background-color
|
---|---|
値 | <color> |
初期値 | transparent |
対象 | 全ての要素 |
継承 | されない |
百分率 | 受容しない |
算出値 | 算出色 |
アニメーション型 | 算出値の型による |
このプロパティは、要素の 背景色 を設定する。色はどの背景画像よりも背後に描かれる。
<DIV style="background-color:#888; padding:10px"> <SPAN style="background-color:yellow">あ </SPAN><BR> <SPAN style="background-color:#ff0">あ </SPAN><BR> <SPAN style="background-color:#ff08">あ </SPAN><BR> <SPAN style="background-color:rgb(255,255,0)">あ </SPAN><BR> <SPAN style="background-color:rgba(255,255,0,0.5)">あ </SPAN><BR> </DIV>
transparent
○ ⤴
<DIV style="background-color:#888; padding:10px"> <SPAN style="background-color:yellow">あ </SPAN><BR> <SPAN style="background-color:#ff08">あ </SPAN><BR> <SPAN style="background-color:transparent">あ </SPAN><BR> </DIV>
h1{ background-color: #F00 } /* 背景を赤色に設定する。 */
背景色の塗り区画は、[最も背後の背景画像層]に対応する[background-clip の層値]に則って、外側が切り取られる。
表示内容: |
表示内容: |