書式 position:幅
対象全ての要素
継承しない
初期値 static
解説
表示する際に使用する座標系を指定します。以下のものが指定できます。
設定名 | 内容 |
absolue | 絶対座標系 |
fixed | 左上の表示位置を原点固定にする |
relative | 相対座標系 |
static | HTMLレイアウトルールに従う |
サンプルコード
<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>