「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の値>

関連資料

このページ「CSS/背景」は、まだ書きかけです。加筆・訂正など、協力いただける皆様の編集を心からお待ちしております。また、ご意見などがありましたら、お気軽にトークページへどうぞ。