Ways to stick footer to the bottom a page

后端 未结 3 1637
再見小時候
再見小時候 2021-01-06 16:38

I followed the How do you get the footer to stay at the bottom of a Web page? post on stackoverflow...

But i couldn\'t make it too work in an asp.net web applicatio

相关标签:
3条回答
  • 2021-01-06 16:48

    I suggest to use a div like

    <div id="Footer"> content </div>
    

    then in your css put this

    #Footer
    {
        position: absolute;
        bottom: 0px;
        height: 3px;
        background-color: #666;
        color: #eee;
    }
    

    or you can use AjaxControlToolkit library


    I Also strongly recommand you change your layout from Table to div

    0 讨论(0)
  • 2021-01-06 16:51

    I'm would also recommend a div structure using floating.

    Markup:

    <div class="bodyWrap">
      <div class="header">
        <!-- Insert content here -->
      </div>
      <div class="content">
        <!-- Insert content here -->
      </div>
      <div class="footer">
        <!-- Insert content here -->
      </div>
      <div style="clear:both"></div>
    </div>
    

    Css:

    .bodyWrap
    {
     width: 500px;
    }
    .header, .content, .footer
    {
     width: 100%;
     float:left;
    }
    
    0 讨论(0)
  • 2021-01-06 17:00

    I liked below better. It only works with an id and not with a class.

    <div id="Footer"> content </div>    
    #Footer {
                        position: fixed;
                        bottom: 0px;
            }
    
    0 讨论(0)
提交回复
热议问题