Loose-Info.com
Last Update 2007/01/16
TOP - CSS1(Cascading Style Sheets, level 1) - padding

要素のパディングを指定します。
指定する値の個数によってtop、right、bottom、leftにどの値を適用するかが決まります。
パーセント値も指定可能です。

(例)
<HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE>テスト</TITLE> <STYLE type="text/css"> <!-- TD {height: 300} .test1 {font: 12pt monospace; background-color: mediumspringgreen; padding: 30px} .test2 {font: 12pt monospace; background-color: mediumspringgreen; padding: 30px 50px} .test3 {font: 12pt monospace; background-color: mediumspringgreen; padding: 30px 50px 60px} .test4 { font: 12pt monospace; background-color: mediumspringgreen; padding: 30px 50px 60px 100px } --> </STYLE> </HEAD> <BODY> <TABLE width="800" border="1" cellspacing="0"> <TR> <TD><P> <SPAN class="test1"> 全マージン30px </SPAN> </P></TD></TR> <TR><TD><P> <SPAN class="test2"> 上下マージン30px左右マージン50px </SPAN> </P></TD> </TR> <TR> <TD><P> <SPAN class="test3"> 上マージン30px左右マージン50px下マージン60px </SPAN> </P></TD></TR> <TR><TD><P> <SPAN class="test4"> 上マージン30px右マージン50px下マージン60px左マージン100px </SPAN> </P></TD> </TR> </TABLE> </BODY> </HTML>