text-align でブロック要素を揃える


box02

DOCTYPE

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

X/HTML

<div id="box01">
  <div id="box02">box02</div>
</div>

CSS

div#box01 {
  text-align: center;
}

div#box02 {
  width: 300px;
  height: 200px;
}

Taichi Kaminogoya.