css使一个按钮保持在页面底部,内容超出屏幕后,保持在内容底部跟随内容一起滚动

<style>
    body,html{ 
    	height: 100%; 
   	 	width: 100%; 
    	overflow: auto;
    }
    .content{
       width: 100%;
        min-height: 100%;   //重要
    }
    footer{
        width: 100%;
        height: 400px;      
        maigin_top= -400px;    //高度相关
        background: #666;
    }
</style>
 
<div>
    <div class="content">页面内容</div> 
    <footer>底部</footer>
</div>

版权声明:本文为weixin_42864357原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。