使背景图像粘在页面底部

时间:2013-02-01 16:42:45

标签: html css

this website上,页脚中的背景图片应该粘贴在页面底部。我不是指页面的可见部分,而是页面的最底部。但是,在内容较短的网页上like this one - 它显示在底部之上一段距离。

我目前使用的CSS是:

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;
}

2 个答案:

答案 0 :(得分:3)

你要求做的是更符合“粘性页脚”的概念。 Exampletutorial

答案 1 :(得分:-7)

使用float属性怎么样:

float: bottom;