Get the App
SLTechnology News&Howtos  ›  Development  › 

How to put the footer tag in html5 at the bottom of the page

Shulou Source: shulou.com Published: 2022-06-02 01:04:20 11月11日 Update

This article "how to put the footer tag in html5 at the bottom of the page" most people do not understand the knowledge points of the article, so Xiaobian summarized the following content for everyone, the content is detailed, the steps are clear, and it has certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "how to put the footer tag in html5 at the bottom of the page" article.

The details are as follows:

_JavaScript:

$(function(){ function footerPosition(){ $("footer").removeClass("fixed-bottom"); //Full text height var contentHeight = document.body.scrollHeight, //Visual window height, excluding toolbar at top of browser winHeight = window.innerHeight; if(! (contentHeight > winHeight)){ //Add fixed-bottom class to footer when the height of web page body is less than the height of visible window $("footer").addClass("fixed-bottom"); } else { $("footer").removeClass("fixed-bottom"); } } footerPosition(); $(window).resize(footerPosition); });

CSS:

.fixed-bottom { position: fixed; bottom: 0; width:100%;} The above is about the content of this article on "how to put the footer tag in html5 at the bottom of the page". I believe everyone has a certain understanding. I hope the content shared by Xiaobian will be helpful to everyone. If you want to know more relevant knowledge content, please pay attention to the industry information channel.

Tags: Content height bottom tags pages articles text knowledge articles web pages values full text most that is tools toolbars more steps browsers knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Microsoft macOS NVidia Shulou Technology