永发信息网

position:fixed的css靠右对其的问题,具体如下

答案:2  悬赏:0  手机版
解决时间 2021-11-11 06:39
  • 提问者网友:练爱
  • 2021-11-11 00:05
position:fixed的css靠右对其的问题,具体如下
最佳答案
  • 五星知识达人网友:神鬼未生
  • 2021-11-11 01:08

#yz_div { width: 1000px; margin: 0 auto;}
#div1{width: 800px; height: 500px;background-color: red; float:left;}
#div3 {width: 200px; float:left; position: relative;}
#div2{width: 30px; position: fixed;height: 200px;background-color: yellow;}


    
    
        
    
追问这样就不是div1居中了,和其他地方没法对齐追答
#div1{width: 800px; height: 500px;background-color: red; margin: 0 auto; position: relative;}
#div2{width: 30px; position: fixed;height: 200px;background-color: yellow; margin-left: 800px;}


    
全部回答
  • 1楼网友:酒安江南
  • 2021-11-11 02:23


追问这个肯定不行,自适应都会有个min-width
比如我给div1一个min-width:600px; 你再试试追答