Bootstrap footer at the bottom of the page

前端 未结 4 1174
失恋的感觉
失恋的感觉 2021-01-31 03:32

I have read a lot of posts about this but I still didn\'t find an answer. I have a footer that I want to be at the end of the page, not fixed. The problem is th

4条回答
  •  礼貌的吻别
    2021-01-31 04:15

    Use this stylesheet:

    /* Sticky footer styles
    -------------------------------------------------- */
    html {
      position: relative;
      min-height: 100%;
    }
    body {
      /* Margin bottom by footer height */
      margin-bottom: 60px;
    }
    .footer {
      position: absolute;
      bottom: 0;
      width: 100%;
      /* Set the fixed height of the footer here */
      height: 60px;
      line-height: 60px; /* Vertically center the text there */
      background-color: #f5f5f5;
    }
    
    
    /* Custom page CSS
    -------------------------------------------------- */
    /* Not required for template or sticky footer method. */
    
    body > .container {
      padding: 60px 15px 0;
    }
    
    .footer > .container {
      padding-right: 15px;
      padding-left: 15px;
    }
    
    code {
      font-size: 80%;
    }

提交回复
热议问题