vertical and horizontal alignment and height percentage not working correctly in firefox Although it works fine on IE and Chrome
i set hight and width to 100% in html and body
html,body { heigh:100% ; width:100% }
and i tried all possible solutions like text-align: -moz-center; display:block;
and here’s my code
<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>
notice: the table doesn’t take the 93% of the page. it takes like an auto .and thats happened when I put <!DOCTYPE html> before html tag
margin:0 autoto center your table.For example:
And you have some misconvenience in your code:
Firefox simply goes mad if you use
height:93%and then you useheight:42px,height:196pxfor rows. I believe Firefox is using more strict method to render HTML+CSS when you use<!DOCTYPE html>tagAlso.. don’t use
text-alignfortable,tr– because they doesn’t contains any text. Use it only fortd