Use css to fix the bottom footer (solve the problem of bottom moving up when the content is not full)

Source: Internet
Author: User
First, let's take a look at my recent problems: when the content of the article is not filled up, footer moves up at the bottom of the website, which is unacceptable to many customers. The css solution is as follows: & amp; lt; html & amp; gt; & amp; lt; head & amp; gt; & amp;

First, let's take a look at my recent problems:

When the content of the article is not filled up, footer moves up at the bottom of the website, which is unacceptable to many customers.

The css solution is as follows:


       
      
  • This is the content www.phpddt.com
  • This is the content www.phpddt.com
  • Note: # the padding value and footer height of main are the same as those of negative margin values.

    If you see it, the solution will no longer let your footer hover over the air:
     

    Another tips is to set the div's default height. When the content is too long, it will automatically lengthen:

    Min-height: 200px; height: auto;

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.