今天在写后台的时候,用了通常的frameset方法,下面是经过调试后的样例。
经过重置后,IE6、IE7、IE8、IE9、FF4、Opera11下可以保持一致了,但是Google Chrome11左右栏还是出现了白色分界,然后分析了下frameset和frame标记的属性,发现嵌套在里面的frameset没有重置属性,然后按照外面的frameset属性
frameborder="0" border="0" framespacing="0"
对里面的frameset(即左右栏)也重置了下,Chrome11也好了。这说明Chrome在框架的属性继承上和其他浏览器有别。但只要我们在写frameset时把全部属性都定义无或0,也就不会有太大差异了。
下面是我写的一个标准样例,以后这样套用就可以了:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>管理中心</title><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><script type="text/javascript"><!--if (window.top != window) window.top.location.href = document.location.href;//--></script></head><frameset rows="100,*" frameborder="0" border="0" framespacing="0"> <frame src="top.html" name="topFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" target="main" /> <frameset cols="200,*" id="frame" frameborder="0" border="0" framespacing="0"> <frame src="left.html" name="leftFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" target="main" /> <frame src="main.html" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="_self" /> </frameset><noframes><body></body></noframes></html>
转自:http://hi.baidu.com/strongpxq/blog/item/59749d2dec8b69f38b13997a.html

本文讨论了使用frameset方法在不同浏览器中保持一致性的经验,特别指出Chrome在框架属性继承上的差异,并提供了一个标准样例来解决此问题。

被折叠的 条评论
为什么被折叠?



