简体   繁体   中英

make background image stick to bottom of page

On this website there's a background image in the footer that should stick to the bottom of the page. I don't mean the visible part of the page, but rather the very bottom of the page. However on pages where the content is short - like this one - it appears some distance above the bottom.

The CSS that I'm currently using is:

html {
  background: url(../images/responsive/bg.svg) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  outline:0!important;
}

What you're asking to do is more in-line with the concept of a "sticky footer". Example and tutorial

如何使用float属性:

float: bottom;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM