div get shrinked when using postion: fixed

前端 未结 3 949
情歌与酒
情歌与酒 2021-01-28 02:14

I\'m having a

and I want to make it\'s position: fixed. I\'ve added CSS rule position:fixed but after adding that the
3条回答
  •  北海茫月
    2021-01-28 02:34

    In that case, you should define the width of your

    whose position is fixed. Let's say for example:

    .div {
       width: 80%; // or whatever you want to be the size
    }
    

提交回复
热议问题