我有一个宽度为 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/