What are the ways to implement this layout?

when a content, and a footer,content+footer are greater than the screen height, the footer follows the content, and when the content+footer is less than the screen height, the footer is at the bottom

.
Mar.19,2021

now has the viewport size unit of vh. Set the parent element of content and footer to min-height: 100vh position of Footer to set relative,bottom to 0


can also be achieved with JS, first get content and footer these two elements, and then through window.innerheight to compare the two high sum, and then father-child absolute positioning.

Menu