XHTML不支持height=100%
当页面上存在XHTML的声明时:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
如果页面上存在iframe,即使添加了height=100%,iframe也不会填充页面。只有移出这个doctype的声明,iframe才会达到预期的效果。填充页面。例如:"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Default</title>
</head>
<body>
<table border="0" style="width:100%;height:100%" cellspacing="0" cellpadding="0">
<tr>
<td style="width:10%;"></td>
<td>
<iframe id="content" scrolling="auto" name="content" frameborder="1" src="a.htm" width="100%" height="100%">
</iframe></td>
</tr>
</table>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Default</title>
</head>
<body>
<table border="0" style="width:100%;height:100%" cellspacing="0" cellpadding="0">
<tr>
<td style="width:10%;"></td>
<td>
<iframe id="content" scrolling="auto" name="content" frameborder="1" src="a.htm" width="100%" height="100%">
</iframe></td>
</tr>
</table>
</body>
</html>
posted on 2007-12-29 18:54 Boringlamb 阅读(587) 评论(1) 编辑 收藏 举报