[英]CSS or JS solution to forcing a page to have no downward scroll and remain 100% window height
我試圖確保頁面只顯示窗口的高度,即使調整大小,也不會向下滾動。 我不想滾動條。 我目前嘗試的方法是:
<!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調整大小以適應頁面,必要時拉伸。
嘗試將CSS規則應用於正文和iframe
body, .wrapper, iframe {
height:100%;
width:100%;
overflow:none;
}
如果你給你的包裝器一個position: absolute
這應該適用於大多數現代瀏覽器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.