search
LoginSignup
4

More than 5 years have passed since last update.

posted at

縦方向にセンタリング

残念ではあるけど、displaytabletable-cellを使う。

.outer {
  display: table;
  height: 100px;
}
.inner {
  display: table-cell;
  height: 100%;
  vertical-align: middle;
}
<div class="outer">
  <div class="inner">
    <p>ほげ</p>
  </div>
</div>

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
4