position

書式 position:幅
対象全ての要素
継承しない
初期値 static
解説
表示する際に使用する座標系を指定します。以下のものが指定できます。
設定名内容
absolue絶対座標系
fixed左上の表示位置を原点固定にする
relative相対座標系
staticHTMLレイアウトルールに従う
サンプルコード
<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;border:1px black solid;
left:10px;
top:10px;
width:300px;
height:100px;
}
--></style>
</head>
<body>
<img src="Default.png">
<div>Dashboard Sample Text</div>
</body>
</html>
実際のサンプルをダウンロード