margin-left

書式

margin-left:間隔

対象

全ての要素

継承

しない

初期値

0

バージョン

CSS Level 1

対応ブラウザ

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

解説

ボックスの左の余白を指定します。間隔を示す値またはautoを指定できます。
サンプルコード
<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; left:10px; top:10px;width:300px;height:100px;
border:1px black solid;
margin-left:20px;
}
--></style>
</head>
<body>
<div>CSS<br>Sample Text</div>
</body>
</html>
実際のサンプルを実行する