サンプル画像(小)
サンプル画像(大)
①背景色 / background-color
カラーネーム、カラーコード、RGB、RGBAで指定する
初期値はtransparent(透明)
②背景画像 / background-image
初期値はnone
③画像の繰り返し表示 / background-repeat
no-repeat / 1回限り、繰り返しなし
repeat / 縦横両方向に繰り返し
repeat-x / 横方向に繰り返し
repeat-y / 縦方向に繰り返し
round / 画像の縦横比で調節
space / 余白で調節
④背景の表示領域 / background-clip(background-colorで確認すればわかりやすい)
border-box / borderとpaddingを含む領域に表示
padding-box / borderを除きpaddingを含む領域に表示
content-box / borderとpaddingを除く領域に表示
⑤画像の表示起点 / background-origin
padding-box / borderを除きpaddingを含む領域の左上が起点
border-box / borderとpaddingを含む領域の左上が起点
content-box / borderとpaddingを除く領域の左上が起点
⑥画像サイズ / background-size /
auto / オリジナルサイズ
contain / 表示領域に入り切る最大サイズ
cover / 表示領域を埋め尽くす最小サイズ
px / 横 縦 の順に指定(1つだけ指定すればwidth、heightはauto)
% / 横 縦 の順に指定(表示領域に対する割合、1つだけ指定すればwidth、heightはauto)
⑦画像の表示位置 / background-position(px, %は左上が起点)
左上 / left top = 0% 0% = left 0% top 0% = right 100% bottom 100%
中上 / center top = 50% 0% = left 50% top 0% = right 50% bottom 100%
右上 / right top = 100% 0% = left 100% top 0% = right 0% bottom 100%
右中 / right center = 100% 50% = left 100% top 50% = right 0% bottom 50%
右下 / right bottom = 100% 100% = left 100% top 100% = right 0% bottom 0%
中下 / center bottom = 50% 100% = left 50% top 100% = right 50% bottom 0%
左下 / left bottom = 0% 100% = left 0% top 100% = right 100% bottom 0%
左中 / left center = 0% 50% = left 0% top 50% = right 100% bottom 50%
中央 / center = 50% = left 50% top 50% = right 50% bottom 50%
⑧画像の移動 / background-attachment
scroll / スクロール
fixed / 固定
local / 子要素でもスクロール
⑨背景色と背景画像、背景画像同士の混合 / background-blend-mode
normal /
multiply /
screen /
overlay /
darken /
lighten /
color-dodge /
color-burn /
hard-light /
soft-light /
difference /
exclusion /
hue /
saturation /
color /
luminosity /
HTML
JavaScript