【发布时间】:2011-10-25 10:15:01
【问题描述】:
我使用下面的 CSS 更改了论坛的背景
http://forum.antinovaordemmundial.com
html {
background: url(http://antinovaordemmundial.com/mystuff/logo_blog.jpg) no-repeat center center fixed;
background-image: url(http://antinovaordemmundial.com/mystuff/logo_blog.jpg);
background-repeat-x: no-repeat;
background-repeat-y: no-repeat;
background-attachment: fixed;
background-position-x: 50%;
background-position-y: 50%;
background-origin: initial;
background-clip: initial;
background-color: initial;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
图片为 1600x711 和 88k。页面的滚动现在非常慢。 CSS 有问题还是图像应该更小?
编辑:我尝试更改为:
body {
color: #000;
font-family: Verdana, Arial, Sans-Serif;
font-size: 13px;
text-align: center; /* IE 5 fix */
line-height: 1.4;
background-attachment: fixed;
background-clip: initial;
background-color: #51010E;
background-image: url(http://antinovaordemmundial.com/mystuff/logo_blog.jpg);
background-origin: initial;
background-position: initial initial;
background-repeat: initial initial;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;
margin-top: 0;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
}
但是滚动还是很慢。
【问题讨论】:
-
我使用的是 chrome,但我也尝试使用 firefox。
-
对我来说并不慢或迟钝(Chrome 13)
-
我在 Chrome 13 中遇到了一些延迟,并且在滚动时会导致大量 CPU 使用。如果删除背景图像,问题会消失吗?
-
+1 表示 Chrome 13 中 CPU 使用率较高——滚动时它会占用我 100% 的内核
-
另外,从设计的角度来看,当内容的宽度保持不变时,调整背景大小似乎不是一个好主意。看起来您正在尝试使用背景使中间区域发出白色光。除非它们一致地动态调整大小,否则它将无法正常工作。
标签: css background vertical-scrolling smooth-scrolling