bootstrap网页自适应问题

2025-03-14 22:34:51
推荐回答(4个)
回答1:



    
        ...
    


    
        
            

bottom div


        

    

    



    .wrapperXXX {
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .mainXXX {
        background-color: pink;
        height: 100%;
    }

    .bottomXXX {
        background-color: lime;
    }


效果:

窗口缩小时:


拉大时:

回答2:


 
    
        ...
    

 
    
        
            

bottom div


        

    

     

 

    .wrapperXXX {
        position: fixed;
        width: 100%;
        height: 100%;
    }
 
    .mainXXX {
        background-color: pink;
        height: 100%;
    }
 
    .bottomXXX {
        background-color: lime;
    }

效果:

窗口缩小时:

拉大时:


回答3:

:占100%的视口宽度

回答4:

1不用设定高度,或设定为style="height: auto;"

相关问答