背景图像css

时间:2010-07-29 06:39:56

标签: css

新手问题,但我无法弄清楚:

如何使背景图像覆盖整个页面但不重复?

感谢

2 个答案:

答案 0 :(得分:1)

body{
  background-image:url(path to image) no-repeat left top
}

你的图像应该足够大,因为你没有重复它。

答案 1 :(得分:0)

* { margin:0; padding:0; }
body { background:url(/file.jpg) no-repeat top center; }

如果它看起来你可能需要更高的高度。

html, body { height:100%; }