background-attachment: 画面をスクロールするかどうか
background-attachment: 値;
プロパティ仕様
値 | 説明 |
---|---|
fixed | 背景画像を固定 |
scroll | 背景画像をスクロール |
background-attachment: fixed 背景画像を固定
上一列に並べた背景画像を固定します。
sample css ↓
body{
background-image: url(画像のアドレス);
background-repeat: repeat-x;
background-attachment: fixed;
}
background-attachment: scroll 背景画像をスクロール
sample css ↓
body{
background-image: url(画像のアドレス);
background-repeat: repeat-x;
background-attachment: scroll;
}