0

我有一个可以缩放页面整个宽度的正文背景。

目前,它设置为 background-size: 100% 50px;

100% 非常适合大屏幕:背景按预期跨越页面的宽度。我也在寻找适用于小屏幕(和手机!)的东西。

4

2 回答 2

1

我将背景从 body{} 移到了 html{}

于 2013-01-19T13:54:40.170 回答
1

将代码移至html

html { 
  background: url(image.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
于 2013-01-19T14:05:20.853 回答