Css img行为标记导致多个HTTP请求

Css img行为标记导致多个HTTP请求,css,http,behavior,Css,Http,Behavior,我们在WebSpherePortal服务器上部署了两个portlet。在css文件中,我们为img标记包含了一个行为属性 img { position:relative; border:none; outline:none; behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" &

我们在WebSpherePortal服务器上部署了两个portlet。在css文件中,我们为img标记包含了一个行为属性

img {
    position:relative;
    border:none;
    outline:none;
    behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none", this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')", this.src = "transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("', '').replace('")', ''), this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')", this.runtimeStyle.backgroundImage = "none")), this.pngSet=true) );
}
我们已经发现这个行为标签导致了多个HTTP请求

<link rel="stylesheet" type="text/css" title="Style"
    href=''<%=request.getContextPath()+"/theme/stylesheet.css" %>'>

雅虎!有一篇文章标题为“加速网站的最佳实践”。要避免的一件事是CSS中的表达式,因为它们的计算频率比预期的要高,只需移动鼠标或滚动页面即可

本文可在此处阅读并查找标题“避免CSS表达式”: