CSS implementation Absolute Bottom

Source: Internet
Author: User

The simple CSS is that it is easy to learn, the difficulty of CSS is to find a better solution. In the world of CSS, there seems to be no perfect this argument. So, now the introduction of the absolute bottom of the CSS, but the current individual has seen the scheme is relatively perfect bar.

Let's start by saying why we use this CSS bottom layout solution:

As a page, if the page content is small, not enough to fill a screen of the window area, according to the normal layout, will appear in the image below (that is, the bottom of the content is not located at the bottom of the window, leaving a lot of blank.

  

For the imperfect designers, this is not beautiful. There are some solutions on the web, but there are bugs that overlap the bottom and body when changing the height of the window. Although not many people will have nothing to change the height of the window, but the design, the pursuit is perfect.

  

Below is I found a more perfect method, from the design of the people from abroad, pure CSS, you can achieve: when the body content is very small, the bottom is in the window below. When you change the height of the window, there is no overlap problem.

  

Even the person who created the CSS specifically set up a website to introduce this CSS bottom layout scheme. Do not know if he has to apply for a patent:)

HTML code:

<div id= "Wrap" >
<div id= "main" class= "Clearfix" >
<div id= "Content" >
</div>
<div id= "Side" >
</div>
</div>
</div>
<div id= "Footer" >
</div>

Description: The premise of using this layout is footer to use a layer outside the total div container, and all other content uses a total layer. Footer If you do need to add other sibling layers, then this sibling layer must use Position:absolute for absolute positioning.

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.