<!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>
<title></title>
</head>
<body>
<iframe src="x.htm" name="content" id="content" allowtransparency="true" align="default" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" height="200" width="780" onload="this.height=0;var fdh=(this.Document?this.Document.body.scrollHeight:this.contentDocument.body.offsetHeight);this.height=(fdh>200?fdh:200)">This message is only visible to older browsers.</iframe>
</body>
</html>
x.htm为被包含的页面

本文介绍了一种使用XHTML标准结合iframe元素实现自适应高度的网页设计方法。通过特定的iframe属性设置,确保了子页面能根据内容自动调整高度,从而避免了传统固定高度布局的局限性。
1万+

被折叠的 条评论
为什么被折叠?



