「CSS/背景」の版間の差分
< CSS
削除された内容 追加された内容
CSS 背景の指定 |
(相違点なし)
|
2005年6月21日 (火) 12:12時点における版
背景色
- 属性
- background-color
- 値
- 数値
- 色名
- transparent
記述例(ソースコード) | 表示例 |
---|---|
p { color: #000000 background-color: #ffffff } |
ヨーグルトに牛乳を加える。 |
背景画像
背景画像を指定
- 属性
- background-image
- 値
- url(<画像のURL>)
- none
背景画像を固定
- 属性
- background-attachment
- 値
- scroll
- fixed
背景画像の並び方
- 属性
- background-repeat
- 値
- repeat
- repeat-x
- repeat-y
- no-repeat
背景画像の表示位置
- 属性
- background-position
- 値
- 数値
- パーセント
- left・center・right・top・bottom
Microsoft Internet Explorerには、水平方向の位置・垂直方向の位置のみを指定する方法があります。
背景の設定をまとめて指定
- 属性
- background
- 値
- <background-colorの値> <background-imageの値> <background-attachmentの値> <background-repeatの値> <background-positionの値>