首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

为何网页顶部会有一行空白的部分

2012-09-25 
为什么网页顶部会有一行空白的部分?如图,白色箭头指示的部分!!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1

为什么网页顶部会有一行空白的部分?

如图,白色箭头指示的部分!


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>活动</title>
<link rel="shortcut icon" href="favicon.ico"/>
<style type="text/css">
<!--
body {
background-image: url(images/bg.gif);
background-repeat: repeat;
}
.STYLE4 {
font-size: 12px;
color: #FFFFFF;
}
.STYLE6 {font-size: 13px; color: #FF0000;}
.STYLE10 {
font-size: 13px;
color: #0000FF;
}
.STYLE11 {color: #FF0000}
.STYLE12 {font-size: 13px}
.STYLE14 {color: #0000FF}
a:link {
color: #000000;
}
.STYLE15 {font-size: 12px}
.STYLE16 {color: #000000}
-->
</style>
</head>
<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
<noscript><iframe scr="*.htm"></iframe>
</noscript>
<body>
<table width="750" height="252" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
  <td width="10" height="202" background="images/bain.GIF">&nbsp;</td>
  <td width="721" background="../mc_logo.gif"><span style="Z-INDEX: 1; LEFT: 218px; WIDTH: 546px; POSITION: absolute; TOP: 12px; HEIGHT: 210px">
  <object 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" 
height="252" width="547" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
  <param name="movie" value="images/2x8.swf" />
  <param name="quality" value="high" />
  <param name="wmode" value="transparent" />
  <param name="menu" value="false" />
  <embed src="images/2x8.swf" quality="high" 
pluginspage="http://www.macromedia.com/go/getflashplayer" 
type="application/x-shockwave-flash" width="547" height="252" 
wmode="transparent" menu="flase"></embed>
  </object>
  </span>
  <div id="Layer7" 
  style="Z-INDEX: 4; LEFT: 596px; WIDTH: 462px; POSITION: absolute; TOP: 13px; HEIGHT: 195px">
  <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj5" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="466" height="252">
  <param name="movie" value="images/1x6.swf">
  <param name="quality" value="High" />
  <param name="wmode" value="transparent" />
  <embed src="images/1x6.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj5" width="466" height="252" quality="High" wmode="transparent"></embed>
  </object>
  </div></td>
  <td width="10" background="images/bain.GIF">&nbsp;</td>


  </tr>
</table>
<table width="750" height="426" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
  <td width="10" background="images/bain.GIF">&nbsp;</td>
  <td width="727" valign="top" bgcolor="#FFFFFF"><table width="634" height="48" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
  <td width="35" height="48"><img src="images/img_05.gif" width="35" height="48" /></td>
  <td width="464" valign="middle" background="images/img_06.gif"><MARQUEE scrollAmount=3 behavior=alternate>
  <span class="STYLE4"></span>
  </MARQUEE></td>
  <td width="135"><img src="images/img_08.gif" width="141" height="48" /></td>
  </tr>
  </table>
  <span class="STYLE6"><br />
<br />
  <br /></span><br />
  <br />
  <table width="348" height="227" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
  <td width="348" height="227" background="images/dlk.jpg"><p><span class="STYLE6"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="STYLE15"></span></span><span class="STYLE15"></span></span><span class="style46" style="FONT-SIZE: 10.5pt; LINE-HEIGHT: 150%; FONT-FAMILY: Verdana">
  <input name="textfield" class="STYLE12" size="14" maxlength="10" />
  </span><span class="STYLE54 style1"><br />
  <br />
  <span class="STYLE10">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="STYLE15"></span></span></span>
  <input name="myText" 
  type="password" class="STYLE12" size="14" maxlength="4" />
  <br />
  <span class="STYLE12">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="image" name="myButton" src="images/dllj.gif" width="95" height="24">
  <p align="center"><span class="STYLE15">注:<span class="STYLE11"></span></span>
  <script language="vbs" type="text/vbs">
  </script>
  <p>
  </td>
  </tr>
  </table>
  <center>
  <br />
  <span class="STYLE6"><img src="images/tel.gif" width="15" height="15" />:<span class="STYLE16">/span><br />


  <br />
  <span class="STYLE14">温馨提示:</span></span><br />
  <br />
  <hr size="1" />
  <table width="436" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
  <td width="407" align="center" valign="middle"><span class="STYLE15">增值电信业务经营许可证:<a href="http://mat1.qq.com/www/images/icp2009.jpg" target="_blank">粤B2-20090059</a> <a href="http://mat1.qq.com/www/images/icp20090028.jpg" target="_blank">B2-20090028</a><br />
  Copyright &copy; 1998 - 2012 Tencent. All Rights Reserved<br />
  <a href="#" target="_self">粤府新函[2001]87号</a> <a href="http://mat1.gtimg.com/www/images/cul2011.jpg" target="_blank">粤网文[2011]0483-070号</a> <a href="http://mat1.gtimg.com/www/images/stxk2009.jpg" target="_blank">网络视听许可证1904073号</a></span> <br />
  </td>
  <td width="29" height="48" valign="middle"><img src="images/gongshang.png" width="29" height="39" border="0" /></td>
  </tr>
  </table>
  </center></td>
  <td width="10" height="426" background="images/bain.GIF">&nbsp;</td>
  </tr>
</table>
</body>
</html>

[解决办法]
body有默认的margin
设置一下body{margin:0}就行了

热点排行