上下左右の余白幅を揃える
contentの幅、高さがディスプレイの大きさ以下で固定されているときなどに使える。
(body)
(div id="contents")
(/div)
(/body)
の場合、CSSファイルに
#contents {
width: 920px;
height: 580px;
position: absolute;
top: 50%;
left: 50%;
margin: -310px 0 0 -480px;
padding: 20px;
}
と書く。