我试图确保页面只显示窗口的高度,即使调整大小,也不会向下滚动。我不想要滚动条。我目前尝试的方法是:
<!DOCTYPE html>
<html>
<head>
<style>
.wrapper
{
height:100%;
overflow:none;
}
</style>
</head>
<body>
<div class="wrapper">
<iframe src="https://media.embed.ly/1/frame?url=http%3A%2F%2Fwww.twitch.tv%2Fgamemode_mc_&width=1280&secure=true&key=0202f0ddb5a3458aabf520e5ab790ab9&height=800" width="1280" height="800" border="0" scrolling="no" frameborder="0"></iframe>
</div>
</body>
</html>
我可以做些什么来实现我想要得到的东西?
编辑:事实上,我想强制 iframe 调整大小以适合页面,必要时进行拉伸(stretch)。
最佳答案
尝试将 CSS 规则应用于正文和 iframe
body, .wrapper, iframe {
height:100%;
width:100%;
overflow:none;
}
关于javascript - 强制页面不向下滚动并保持 100% 窗口高度的 CSS 或 JS 解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18820359/