background-position

書式

background-position:横位置 縦位置

対象

ブロックレベル要素、置換要素

継承

しない

初期値

0% 0%

バージョン

CSS Level 1

対応ブラウザ

Win IE4.0以降, Mac IE5.0, NN6.0以降, Firefox, Opera 6, Safari

解説

背景画像の表示位置を示します。
サンプルコード
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<style type="text/css"><!--
body { margin:0px; }
div { position:absolute; top:10;left:10px;
background-image:url(bg.jpg);
width:100px;
background-position:10px 5px;
}
--></style>
</head>
<body>
<div>CSS Sample text.</div>
</body>
</html>
実際のサンプルを実行する