1

我的页眉 bg 图像工作正常,但我似乎无法让页脚延伸到整个网站的宽度。我怎样才能解决这个问题?

   body{
background-image: url(images/topbg.jpg), url(images/footerbg.jpg);
background-position: left top, left bottom;
background-repeat: repeat-x;
} 
4

3 回答 3

0

如果您只想拉伸页脚背景图像,这是一种简单的方法:

body
{
  background-image: url(images/topbg.jpg) left top repeat-x, url(images/footerbg.jpg) left bottom;
  //Make the Background Image stretched
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
} 
于 2013-07-24T10:22:06.840 回答
0

将您的正文边距和填充设置为 0:

body {
  margin: 0;
  padding: 0;
}
于 2013-07-24T10:13:54.540 回答
0

您不想重复背景图像吗?然后替换

background-repeat:no-repeat;

代替

background-repeat: repeat-x;
于 2013-07-24T11:29:32.813 回答