两个页面,代码基本一样,但是test1.htm在firefox 3.6里不能实现topMargin=0,搞不懂,是firefox的特性?请高手赐教。
test1.htm,源码如下
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>这个没有实现topMargin=0</title>
</head>
<BODY leftMargin=0 background="" topMargin=0 >
<script language=javascript>
document.write('<p>这个没有实现topMargin=0 </p>');
</script>
</body>
</html>
test2.htm,源码如下
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>'这个实现了topMargin=0</title>
</head>
<BODY leftMargin=0 background="" topMargin=0 >
<p>
<script language=javascript>
document.write('这个实现了topMargin=0 ');
</script>
</p>
</body>
</html>
------解决方案--------------------------------------------------------
topMargin一直是0,前面那个p多了margin
- HTML code
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>这个没有实现topMargin=0</title><style type="text/css"> p{margin:0px;}</style></head><BODY leftMargin=0 background="" topMargin=0 ><script language=javascript>document.write('<p>这个没有实现topMargin=0 </p>');</script></body></html>
------解决方案--------------------------------------------------------