【发布时间】:2011-08-21 21:27:38
【问题描述】:
好吧,现在我正在尝试使用 Firefox、opera、chrome 支持的 CSS 渐变功能制作一个看起来很酷的表格。
它看起来很棒,但它滞后太多了。当我向下滚动页面时,它会大大滞后。即使在超快的计算机上也很慢,因此它与计算机无关。我还尝试了不同的浏览器仍然滞后。当我禁用渐变背景颜色功能时,它会返回正常。
那么我该如何解决这个问题,或者有没有其他方法可以制作看起来很酷的桌子。谢谢。
这就是表格的样子http://img202.imageshack.us/img202/4905/howlook.png
这是我用于表 tds 的示例类
.ML0
{
color: #000000;
text-decoration: none;
background: rgb(229,229,229);
background: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(229,229,229)), color-stop(0.55, rgb(242,242,242)), color-stop(0.78, rgb(255,255,255)) );
background: -moz-linear-gradient( center bottom, rgb(229,229,229) 9%, rgb(242,242,242) 55%, rgb(255,255,255) 78% );
background: -o-linear-gradient( bottom, rgb(229,229,229) 9%, rgb(242,242,242) 55%, rgb(255,255,255) 78% );
background: -ms-linear-gradient( bottom, rgb(229,229,229) 9%, rgb(242,242,242) 55%, rgb(255,255,255) 78% );
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 5px rgba(0, 0, 0, 0.1) inset;
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.2);
}
【问题讨论】:
-
您可以使用半透明的 1px 宽的白色渐变图像;这不是最佳做法,但需要更少的渲染时间。
-
你能详细解释一下吗?我没明白。
-
对不起,混乱怪物。 @BoltClock 有你的答案:-)
标签: html css background gradient