HTML页脚运动时表为空吗?
-
22-08-2019 - |
题
具有由form标签所包围的数据的表。在该页面的底部具有被固定的页脚。
当该表是空的(仅表头显示)整个页脚转移中途关闭屏幕,到右侧。
任何想法?
<form action="/cgi-bin/Lib.exe" method=POST name="dd" ID="Form1">
<div id="yyy">
<table cellspacing="0" ID="Table1">
<thead>
<tr>
<th>Start</th>
<th>End</th>
</tr>
</thead>
<p><small><font face="Arial"><small>$DATA</small></font></small></p>
<tbody>
<tr>
<td><input type=radio name="begin" value="$START" ID="Radio0"> $START</td>
<td>$END <input type=radio name="end" value="$END" ID="Radio3"></td>
</tr>
<tr>
<td><input type=radio name="begin" value="$START" ID="Radio1"> $START</td>
<td>$END <input type=radio name="end" value="$END" ID="Radio4"></td>
</tr>
<tr>
<td><input type=radio name="begin" value="$START" ID="Radio2"> $START</td>
<td>$END <input type=radio name="end" value="$END" ID="Radio5"></td>
</tr>
</tbody>
</table>
</div>
<p><small><font face="Arial"><small>$DATA</small><strong></p>
</strong></font></small>
</form>
<div id="footer">
<div id="labfooter">
</div>
</div>
在CSS:
#footer {
width:100%;
height:5em;
}
html>body #footer {
position:fixed;
bottom:0;
z-index:10; /* Prevent certain problems with form controls */
}
#header,
#footer {
color:#111;
background:#ddd;
text-align:center;
}
解决方案
这很难,而无需更多的代码的调试。 还其中浏览器(一个或多个)和OS您有问题?
不过,我可以说,你的HTML代码是无效的,而且可以摆脱许多浏览器渲染。有时它可能看起来像它运行良好,但DOM可以路要走从不当代码被抛出。
有关开始尝试在<p>...</p>
和<thead>
<tbody>
其他提示
以验证你的代码开始。你是混合HTML和XHTML代码,并且您的标签结构被打破,所以会有一些事情要解决。
您可能会得到更多的错误信息之外还有实际的错误,所以刚开始在顶部和尽量修复的东西,你清楚地看到错误,然后重新进行验证,看看还剩下些什么。
我不认为:
html>body
之前页脚语句。这是不必要的你正在尝试如何完成和可能导致的问题。
不隶属于 StackOverflow