0

このコードを使用して、全画面の背景を持つ Web ページを持っています

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 に答える