CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page

前端 未结 29 2512
悲哀的现实
悲哀的现实 2020-11-21 23:48

I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that has a footer which I can\'t make sit at the bottom of the page.

I wa

29条回答
  •  后悔当初
    2020-11-22 00:13

    I have used in my many projects and never got any single issue :)

    for your reference, Code are in snippet

    * {
    	margin: 0;
    }
    html, body {
    	height: 100%;
    }
    .wrapper {
    	min-height: 100%;
    	height: auto !important; /* This line and the next line are not necessary unless you need IE6 support */
    	height: 100%;
    	margin: 0 auto -50px; /* the bottom margin is the negative value of the footer's height */
      background:green;
    }
    .footer, .push {
    	height: 50px; /* .push must be the same height as .footer */
    }
    
    .footer{
      background:gold;
      }
    
    
    
    Untitled Document
    
    
    
      
    Content Area

提交回复
热议问题