2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

headerの画像を上下中央寄せする方法

Posted at

まず、HTMLを記載するとこんな感じです。

<div class="p-header__logo">
  <img src="img/header/logo/logo120.png" alt="">
</div>
.p-header__logo {
   height: 90px;
   display: flex;
   align-items: center;
  & img {
    height: 70px;
    display: block;
    }
} 

img要素を囲んでいる親要素に
display: flex;
align-items: center;

を追加すると上下中央揃いになる。

2
2
0

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
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?