html - 如何让页面中的iframe只竖屏显示

标签 html css iframe

我有一个宽度为 800 像素、高度为 200 像素的 iframe。我希望它只在水平方向上显示一个页面。意味着我没有垂直内容。

<iframe src="recipelist/" width="800px" height="250px" scrolling="yes" class="iframe-class" frameborder="0"></iframe>

iframe 的内容是动态生成的页面(博客文章),宽度为 100%,这意味着当有新文章进入时它将水平继续。每个元素的高度为 200px,我显示:inline-block每个元素,以便它水平排列。

为了更好地理解,我只想在垂直线上显示元素。我是否需要对 iframe 或 iframe 中的页面进行编码?

如何让父页面水平显示?意味着没有垂直滚动?只显示最大宽度的 iframe?

最佳答案

<iframe src="www.google.com" class="iframe-class" frameborder="1" scrolling="no"></iframe>

时尚

.iframe-class {
 overflow-x: hidden;
 height: 600px;  
 width: 200px;
 }

关于html - 如何让页面中的iframe只竖屏显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14151400/

相关文章:

javascript - 使用外部脚本在 javascript 中获取表格单元格的值

html - 如何在使用位置 :relative 时增加图像的宽度

javascript - 如何根据子 div 的高度更改父 div 的高度?

javascript - 在 iframe 中运行 Google Analytics?

javascript - 通过 iframe src 进行 xss 攻击

javascript - 需要有关 jQuery 插件的帮助 - TextExt 输入

jquery - CSS - 垂直滚动到 UL 列表

html - 如何在按钮组中分隔 btn?

html - 在 CSS 中模拟选项卡

javascript - Post 方法在 edge 浏览器中不起作用,但它在其他浏览器(如 Firefox)中起作用。互联网浏览器, Chrome