0

我有一个使用此代码的全屏背景网页

html, body {
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}

#background-image{
  z-index: -999;
  min-height: 100%;
  min-width: 1024px;
  width: 100%;
  height: auto;
  position: fixed;
  top: 0;
  left: 0;
  }

这没关系,但我想做的是隐藏图像的 4 个边框并使图像在背景中居中。

看看这张图片来描述我真正需要的东西 https://dl.dropbox.com/u/7064770/Untitled-1.png

任何 javascript 代码也被广泛接受

4

1 回答 1

0

尝试使用 CSS3background-size属性:

#background-image{
  background-size:cover;
  z-index: -999;
  min-height: 100%;
  min-width: 1024px;
  width: 100%;
  height: auto;
  position: fixed;
  top: 0;
  left: 0;
  }
于 2013-01-21T11:58:36.347 回答