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

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

margin-left …… 左マージンを指定する
Internet Explorer4Internet Explorer5Internet Explorer5-macInternet Explorer5.5Internet Explorer6Internet Explorer7Internet Explorer8Internet Explorer9
Netscape4Netscape6Netscape7Netscape8
Opera6Opera7Opera8Opera9Opera10
Firefox1Firefox2Firefox3Firefox4
Google Chrome1Google Chrome2Google Chrome3Google Chrome4Google Chrome5Google Chrome6
広告



margin-leftプロパティは、左マージンを指定する際に使用します。

尚、マージンには負の値を指定することもできます。
マージンに負の値を指定することで、複数の領域を重ねて表示させることが可能ですが、重なり順や重ね位置がブラウザによって異なるため、注意が必要です。

■使用例

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

p.sample1 {background-color: #f8dce0; margin-left: 50px;}

HTMLソース

<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>
<p class=”sample1″>左マージン50px</p>
</body>
</html>

↓↓↓

ブラウザ上の表示

左マージン50px

■関連項目

margin …… マージンに関する指定をまとめて行う
margin-top …… 上マージンを指定する
margin-bottom …… 下マージンを指定する
margin-left …… 左マージンを指定する
margin-right …… 右マージンを指定する
padding …… パディングに関する指定をまとめて行う
padding-top …… 上パディングを指定する
padding-bottom …… 下パディングを指定する
padding-left …… 左パディングを指定する
padding-right …… 右パディングを指定する

Lorem Ipsum is simply dummy text

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