动网论坛帖子只能显示一部分的解决办法(基于IE7核心的CSS问题)
作者:elyoo 日期:2007-06-17
这几天在修改动网论坛模板(非官方模板)的时候,发现了一个BUG,那就是当我发的帖子内容比较长的时候,那个帖子最多只能显示200px的高度,大于200px的部分均不能正常完全显示。
什么原因呢?我找了好久,后来终于发现是IE7.0浏览器与CSS的兼容性问题。
具体原因:模板的CSS与IE7核心的浏览器产生冲突。出现此问题,多数是因为IE7对CSS的解释不同于IE6,所以产生浏览器输出错误页面的结果。只能说IE7在标准方面更向W3C靠近了,而并不是因为IE7浏览器的漏洞原因导致页面错误。
最新的动网官方模板已经修正了这个问题,如果你和我一样在使用和修改非官方模板的时候同样出现了帖子显示不全或者错位的情况,那说明你的模板CSS与IE7.0不兼容。
通常情况由2种方法解决:
1.换非IE7.0核心的浏览器。(最新firefox下载点这里)
2.以上方法对于一个论坛管理者来说无疑是“掩耳盗铃”,你看着没问题不代表别人看着也没问题,如果别人用IE7.0看的话。而且使用IE7.0是大势所趋,用以下方法可以解决动网论坛的帖子显示不全或错位的情况。
在风格模板page_dispbbs的 template.html(0)中找到以下代码:
<!--判断是否是IE,生成相应的style和class--><br />
<xsl:variable name="postclass"><br /><xsl:choose><br />
<xsl:when test="<a href="mailto:post/agent/@browser='Microsoft">post/agent/@browser='Microsoft</a> Internet Explorer'">postie</xsl:when><br />
<xsl:otherwise>post</xsl:otherwise><br />
</xsl:choose><br /></xsl:variable><br />
<xsl:variable name="bodystyle"><br />
<xsl:choose><br />
<xsl:when test="<a href="mailto:post/agent/@browser='Microsoft">post/agent/@browser='Microsoft</a> Internet Explorer'">height:200px;width:97%;padding-right:0px; overflow-x: hidden;</xsl:when><br />
<xsl:otherwise>min-height:200px;</xsl:otherwise><br />
</xsl:choose>font-size:<xsl:value-of select="<a href="mailto:post/setting/@fontsize">post/setting/@fontsize</a>" />pt;line-height:<xsl:value-of select="<a href="mailto:post/setting/@lineheight">post/setting/@lineheight</a>" />;text-indent:<xsl:value-of select="<a href="mailto:post/setting/@indent">post/setting/@indent</a>" />px;
</xsl:variable><br />
<!--end -->
替换为:
<!--判断是否是IE,生成相应的style和class-->
<xsl:variable name="postclass">
<xsl:choose>
<xsl:when test="post/agent/@browser='Microsoft Internet Explorer' and not(post/agent/@version > 6 ) ">postie</xsl:when>
<xsl:otherwise>post</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="bodystyle">
<xsl:choose>
<xsl:when test="post/agent/@browser='Microsoft Internet Explorer' and not(post/agent/@version > 6 )">height:200px;width:97%;padding-right:0px; overflow-x: hidden;</xsl:when>
<xsl:otherwise>min-height:200px;</xsl:otherwise>
</xsl:choose>font-size:<xsl:value-of select="post/setting/@fontsize" />pt;line-height:<xsl:value-of select="post/setting/@lineheight" />;text-indent:<xsl:value-of select="post/setting/@indent" />px;</xsl:variable>
<!--end -->
什么原因呢?我找了好久,后来终于发现是IE7.0浏览器与CSS的兼容性问题。
具体原因:模板的CSS与IE7核心的浏览器产生冲突。出现此问题,多数是因为IE7对CSS的解释不同于IE6,所以产生浏览器输出错误页面的结果。只能说IE7在标准方面更向W3C靠近了,而并不是因为IE7浏览器的漏洞原因导致页面错误。
最新的动网官方模板已经修正了这个问题,如果你和我一样在使用和修改非官方模板的时候同样出现了帖子显示不全或者错位的情况,那说明你的模板CSS与IE7.0不兼容。
通常情况由2种方法解决:
1.换非IE7.0核心的浏览器。(最新firefox下载点这里)
2.以上方法对于一个论坛管理者来说无疑是“掩耳盗铃”,你看着没问题不代表别人看着也没问题,如果别人用IE7.0看的话。而且使用IE7.0是大势所趋,用以下方法可以解决动网论坛的帖子显示不全或错位的情况。
在风格模板page_dispbbs的 template.html(0)中找到以下代码:
<!--判断是否是IE,生成相应的style和class--><br />
<xsl:variable name="postclass"><br /><xsl:choose><br />
<xsl:when test="<a href="mailto:post/agent/@browser='Microsoft">post/agent/@browser='Microsoft</a> Internet Explorer'">postie</xsl:when><br />
<xsl:otherwise>post</xsl:otherwise><br />
</xsl:choose><br /></xsl:variable><br />
<xsl:variable name="bodystyle"><br />
<xsl:choose><br />
<xsl:when test="<a href="mailto:post/agent/@browser='Microsoft">post/agent/@browser='Microsoft</a> Internet Explorer'">height:200px;width:97%;padding-right:0px; overflow-x: hidden;</xsl:when><br />
<xsl:otherwise>min-height:200px;</xsl:otherwise><br />
</xsl:choose>font-size:<xsl:value-of select="<a href="mailto:post/setting/@fontsize">post/setting/@fontsize</a>" />pt;line-height:<xsl:value-of select="<a href="mailto:post/setting/@lineheight">post/setting/@lineheight</a>" />;text-indent:<xsl:value-of select="<a href="mailto:post/setting/@indent">post/setting/@indent</a>" />px;
</xsl:variable><br />
<!--end -->
替换为:
<!--判断是否是IE,生成相应的style和class-->
<xsl:variable name="postclass">
<xsl:choose>
<xsl:when test="post/agent/@browser='Microsoft Internet Explorer' and not(post/agent/@version > 6 ) ">postie</xsl:when>
<xsl:otherwise>post</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="bodystyle">
<xsl:choose>
<xsl:when test="post/agent/@browser='Microsoft Internet Explorer' and not(post/agent/@version > 6 )">height:200px;width:97%;padding-right:0px; overflow-x: hidden;</xsl:when>
<xsl:otherwise>min-height:200px;</xsl:otherwise>
</xsl:choose>font-size:<xsl:value-of select="post/setting/@fontsize" />pt;line-height:<xsl:value-of select="post/setting/@lineheight" />;text-indent:<xsl:value-of select="post/setting/@indent" />px;</xsl:variable>
<!--end -->
评论: 0 | 引用: 0 | 查看次数: 2878
发表评论
你没有权限发表评论!
上一篇
下一篇

文章来自:
Tags: 






