LoginSignup
0
0

More than 3 years have passed since last update.

position争い〜要素が重なった時は?〜

Posted at

要素が重なった時に優先順位を決めたい!

2つの要素にpositionをつけた時、思わぬ形で要素が重なってしまう、、

原因、2つの要素にpositionをつけた時には、勝手に優先順位ができるので、優先順位を手で書き込むこと

header{
position: fixed;z-index:10;//z-index:10;を追加
text-align:center;
}

.tweets-comment{
width: 30vw;
background-color: burlywood;
position: relative;z-index:0; ;//z-index:0;を追加
}

結論! z-index:0;の数字が高い 上 z-index:0;の数字が低い 下になります

直りました。。

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