使用下面的代码 $title1 和 $title2 应该在 div 之外并以页面宽度为中心。它这样做只是因为我在那里有“Y”。如果我删除“Y”,文本会向上移动,并且位于地址类的中心。显然我不能在那里保留“Y”,但不确定为什么会改变事情。
<html>
<head>
<title></title>
<style>
body { margin:12pt auto 12pt auto;width:568pt; }
.sseal { float:left; width:56.25pt; }
.address { float:left;text-align:center; margin:15px auto;width:450pt; }
.dseal { float:right; width:56.25pt;}
wrapper { margin:0px auto; }
.form_title { text-align:center;font-weight:bold;font-size:22pt; }
.header { font-weight:bold; }
.heading { font-size:16pt;font-weight:bold; }
.title1 { font-size:24pt;font-weight:bold;text-align:center; }
.title2 { font-size:22pt;font-weight:bold; font-style:oblique;text-align:center; }
table, th, td { padding:10px; }
hr { padding:0px;spacing:0px;margin:0px; }
.rightpaced { margin:45px; }
</style>
</head>
<body>
<div class="wrapper">
<div class="sseal"><img src="../image2.gif" height="75" width="75" border="0"></div>
<div class="clear:both;"></div>
<div class="address">
<font size=+1><b>
$companyname<br>
$address
</b></font>
</div>
<div class="clear:both;"></div>
<div class="dseal"><img src="../image2.gif" height="75" width="75" border="0"></div>
<div class="clear:both;"></div>
</div>
<div class="clear:both;"></div>
Y<br>
<div class="title1">$title1</div>
<p>
<div class="title2">$title2</div>
</body>
</html>