cnblogs/dcrenl/网页垂直居中(1).html
2024-09-24 12:43:01 +08:00

103 lines
2.9 KiB
HTML

<div id="sina_keyword_ad_area2" class="articalContent ">
<div>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</div>
<div>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</div>
<div>&lt;head&gt;</div>
<div>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;</div>
<div>&lt;title&gt;无标题文档&lt;/title&gt;</div>
<div>&lt;style type="text/css"&gt;</div>
<div>&lt;!--</div>
<div>.kkkk {</div>
<div>background-color: #CCCCCC;</div>
<div>&nbsp;</div>
<div>}</div>
<div>body {</div>
<div>margin-left: 0px;</div>
<div>margin-top: 0px;</div>
<div>margin-right: 0px;</div>
<div>margin-bottom: 0px;</div>
<div>}</div>
<div>--&gt;</div>
<div>&lt;/style&gt;</div>
<div>&lt;/head&gt;</div>
<div>&nbsp;</div>
<div>&lt;body&gt;</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&lt;table
width="100%" border="1" cellpadding="0" cellspacing="0"
class="kkkk" id="mainDiv"&gt;</div>
<div>&nbsp;&nbsp;
&nbsp;&lt;tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp;&lt;td align="center"
valign="middle"&gt;&lt;table width="200"
border="1" cellspacing="0" cellpadding="0"&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp;&lt;tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp;&lt;/tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp;&lt;tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp;&lt;/tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp;&lt;tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;
&nbsp;&lt;td&gt;&amp;nbsp;&lt;/td&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp;&lt;/tr&gt;</div>
<div>&nbsp;&nbsp; &nbsp;
&nbsp;
&nbsp;&lt;/table&gt;&lt;/td&gt;</div>
<div>&nbsp;&nbsp;
&nbsp;&lt;/tr&gt;</div>
<div>
&nbsp;&nbsp;&lt;/table&gt;</div>
<div>&nbsp;</div>
<div>&lt;script type="text/javascript"
language="javascript"&gt;</div>
<div>function OnResize()</div>
<div>{</div>
<div>
window.document.getElementByIdx("mainDiv").style.height=document.documentElement.clientHeight
+ "px";</div>
<div>}</div>
<div>OnResize();</div>
<div>window.onresize = OnResize;</div>
<div>&lt;/script&gt;</div>
<div>&lt;/body&gt;</div>
<div>&lt;/html&gt;</div>
<div>&nbsp;</div>
</div>
<p>&nbsp;</p>