【发布时间】:2012-08-26 06:35:38
【问题描述】:
纵横对齐和高度百分比在 Firefox 中无法正常工作虽然它在 IE 和 Chrome 上工作正常 我在 html 和 body 中将高度和宽度设置为 100%
html,body { heigh:100% ; width:100% }
我尝试了所有可能的解决方案,例如text-align: -moz-center; display:block;
这是我的代码
<table cellpadding="0" cellspacing="0" border="0" style="width: 100%; height: 93%;">
<tr style="height: 42px; width: 100%">
<td style="width: 80px; background-image: url(Images/logo.png); background-repeat: no-repeat;
height: 42px;">
</td>
<td style="height: 42px">
</td>
</tr>
<tr align="center" valign="middle">
<td style="height: 196px;" align="center" valign="middle">
<table class="partTable" style="padding-bottom: 20px">
<tr>
<td align="center" style="font-size: xx-large; font-family: Arial Black; color: #C11B17">
<span>
<%=System.Configuration.ConfigurationManager.AppSettings["AppName"]%>
</span>
</td>
</tr>
</table>
<table border="0" style="text-align: -moz-center; vertical-align: middle; display: block;
margin: 0 auto;">
<tr>
<td valign="middle" class="partHolder" style="width: 314px; height: 201px;">
--Content
</td>
</tr>
</table>
</tr>
注意:表格不占页面的 93%。它需要像自动一样。当我将<!DOCTYPE html> 放在 html 标记之前时,就会发生这种情况
【问题讨论】:
-
margin:0px auto使您的表格居中。顺便说一句height 93% 对我来说很好......