The following is a simple implementation of html footer at the bottom of the page. I think it is quite good. Now I will share it with you and give you a reference. Let's take a look at it with xiaobian.
Requirements:Sometimes, when the page content is short, the browser height is not supported, but footer is expected to be at the lowest end of the window.
Ideas:The minimum height of the parent layer of footer is 100%. If footer is set to a bottom: 0 position relative to the parent layer, the height of footer should be reserved in the parent layer.
Html code:
Copy XML/HTML Code to clipboard
-
-
-
-
-
-
-
-
CSS:
Copy the content to the clipboard using CSS Code.
- # Wapper {
- Position: relative;/* important! Ensure that footer is relative to the position of wapper */
- Height: auto;/* Ensure that the page is displayed normally when the browser height is enabled */
- Min-height: 100%/* not supported by IE6, which must be configured separately */
- }
- # Footer {
- Position: absolute; bottombottom: 0;/* Key */
- Left: 0;/* remember it in IE */
- Height: 60px;/* the height of footer must be a fixed value */
- }
- # Main-content {
- Padding-bottom: 60px;/* important! Space reserved for footer */
- }
At this time, other browsers can be normally displayed, but IE 6 should be handled separately:
Copy the content to the clipboard using CSS Code.
-
The simple implementation method of the above html footer at the bottom of the page is to share all the content with you in the small Editor. I hope you can give us a reference and support the footer home.