【发布时间】:2013-07-02 23:28:05
【问题描述】:
看看下面的代码就知道我的问题了。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<div style='width:100%; background:#CCCCCC; padding:0px; margin:0px; margin-bottom:20px; border:1px solid #CCC;'>
<div style='float:left'>
<a href='#' title='CSS TEST'><span style='font-size:30px;'>TEST for CSS DIV</span></a>
</div>
<div style='float:right'>
Stuff on the right
</div>
<div style='clear:both;'></div>
</div>
<table cellspacing='0' cellpadding='2' align='center' width='1200' border='1'>
<tr>
<td> COL1 </td>
<td> COL3 </td>
</tr>
</table>
</body>
</html>
如果在平板电脑上查看,上述内容会将我的 div 从 100% 降低。但是在电脑上可以正常使用。
如果我删除表格,则 div 跨度为 100%
任何帮助将不胜感激。
你可以在http://zeissimages.com/test.html看到这个代码
只有在删除表定义时,它才能在平板电脑上正常工作。
【问题讨论】:
-
一定是一些我们在这里看不到的 CSS 东西。你能把你的代码放在一个 php 文件之外并重现这个问题吗?
-
@clrockwell 我编辑了帖子并添加了实际代码和链接以查看它的实际效果
标签: html css html-table width