css – 我的固定背景使滚动网站很慢,我可以做些什么来改善它?

前端之家收集整理的这篇文章主要介绍了css – 我的固定背景使滚动网站很慢,我可以做些什么来改善它?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我用下面的CSS改变了我的论坛的背景

http://forum.antinovaordemmundial.com

@H_403_4@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; }

图像是1600×711和88k.页面的滚动现在很慢. CSS是否有问题或图像应该小些吗?

编辑:我尝试改为:

@H_403_4@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; }

但滚动仍然很慢.

解决方法

当我删除background-size属性时,问题消失了.我认为这是导致问题的大图像的缩放.如果不行,那就完全删除背景图片了.然而,我从来没有听说过大型背景影像造成滞后.

猜你在找的CSS相关文章