关于显示溢出(滚动条)的问题
我有一个主页,编码如下;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<table height="100%" cellspacing="0" cellpadding="0" border="0" width="646" class="data border">
<tbody>
<tr>
<td valign="top" class="noPad">
<iframe height="100%" frameborder="0" width="100%" scrolling="no" name="studentFrame" src="delete2.html"></iframe>
</td>
</tr>
</tbody>
</table>
</body>
</html>
iframe 页面编码为;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<table height="100%" cellspacing="0" cellpadding="0" border="0" width="834" class="data border">
<tbody>
<tr>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
</tr>
</tbody>
</table>
</body>
</html>
现在我希望 iframe 在主页中水平滚动。
当 iframe 的宽度大于主包含表的宽度时它会自然滚动还是我们需要显式指定任何属性?
请帮我。谢谢。
I have a main page coded as follows;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<table height="100%" cellspacing="0" cellpadding="0" border="0" width="646" class="data border">
<tbody>
<tr>
<td valign="top" class="noPad">
<iframe height="100%" frameborder="0" width="100%" scrolling="no" name="studentFrame" src="delete2.html"></iframe>
</td>
</tr>
</tbody>
</table>
</body>
</html>
and the iframe page is coded as;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<table height="100%" cellspacing="0" cellpadding="0" border="0" width="834" class="data border">
<tbody>
<tr>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
<td>123</td>
</tr>
</tbody>
</table>
</body>
</html>
Now I want the iframe to scroll horizontally in the main page..
Will it scroll naturally as width of iframe is more than width of main containing table OR do we need to explicitly specify any attribute?
please help me. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不建议将 I 帧放入表中,甚至在这种情况下根本不使用表。
您可以禁用主页上元素的溢出:iframe 和表 td。
溢出:隐藏;
然后对于 iframe 页面的正文,您可以执行以下操作
溢出-x:滚动;
或者您可以尝试实际的 iframe 类。
I wouldn't recommend putting I-frames in tables, or even using tables at all in this scenario.
You can disable overflow for elements on the main page: for the iframe and the table td.
overflow:hidden;
And then for the body of your iframe page you can do
overflow-x:scroll;
or you can try it for the actual iframe class.