【CSSリファレンス】background-repeat
こんにちは(・∀・)
CSSプロパティをご紹介します。今回ご紹介するCSSプロパティはbackground-repeatです。
概要
background-repeatプロパティを使用して指定された背景画像のリピート表示の方法を指定します。
.sample {
background-repeat: repeat-x;
}
適用要素
すべての要素
指定できる値
- repeat
- 全画面にリピート表示
- repeat-x
- 横方向にリピート表示
- repeat-y
- 縦方向にリピート表示
- no-repeat
- リピート表示なし(ひとつだけ表示)
初期値
repeat
サンプル
CSS
body {
background-image: url(bg.png);
background-repeat: repeat-y;
background-position: center top;
}