0
0

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.

REDIMPULZAdvent Calendar 2020

Day 25

他の要素と重ならないように、ヘッダーを上部に固定

Posted at

スクロールした時、他の要素と重ならないように、ヘッダーを上部に固定したい。

:html

. . . ```

固定するためには position: fixedを使用し、
他の要素(文字など)と重ならないようにするためにz-indexを指定する。

:css

.header {
position: fixed;
z-index: 99;
width: 100%;
background-color: white;
}

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?