よく使う水平方向の中央に表示じゃなくて、水平・垂直方向の中央にブロック要素を配置する CSS サンプルを書いてみました。 ↓ こんなの。 ## サンプル ### CSS ソース #container { position: absolute; top: 50%; left: 50%; overflow: auto; width: 400px; height: 300px; margin-top: -150px; /* ボックス高の半分を指定 */ margin-left: -200px; /* ボックス幅の半分を指定 */ } ### HTML ソース ### サンプルファイル – [水平・垂直方向の中央にブロック要素を配置する CSS のサンプル](https://bowz.info/wp-content/uploads/2007/07/1009/index.html) ## 表示確認し