Home » ★スタイルシートリファレンス

★スタイルシートリファレンス

background-attachment …… 背景画像の固定・移動を指定する
Internet Explorer4Internet Explorer5Internet Explorer5-macInternet Explorer5.5Internet Explorer6Internet Explorer7Internet Explorer8Internet Explorer9
Netscape6Netscape7Netscape8
Opera6Opera7Opera8Opera9Opera10
Firefox1Firefox2Firefox3Firefox4
Google Chrome1Google Chrome2Google Chrome3Google Chrome4Google Chrome5Google Chrome6
広告



background-attachmentプロパティは、画面をスクロールする際、
背景画像をその位置に固定されたままにするか、スクロールに伴って移動するかどうかを指定します。

■値

fixed
背景画像の位置が固定され、スクロールしても動かなくなります。
scroll
スクロールに伴って、背景画像も移動します。

■使用例

スタイルシート部分は外部ファイル(sample.css)に記述。

body {
background-image: url(“../images/inu01.jpg”);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: right bottom
}

HTMLソース

<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>


</body>
</html>

■関連項目

color …… 文字色(前景色)を指定する
background …… 背景に関する指定をまとめて行う
background-attachment …… 背景画像の固定・移動を指定する
background-color …… 背景色を指定する
background-image …… 背景画像を指定する
background-position …… 背景画像の表示開始位置を指定する
background-position-x …… 背景画像の横位置を指定する(IE独自の仕様)
background-position-y …… 背景画像の縦位置を指定する(IE独自の仕様)
background-repeat …… 背景画像のリピートの仕方を指定する
広告



Lorem Ipsum is simply dummy text

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.