使尺寸适合屏幕的高度

问题描述

这肯定是一个微不足道的问题,但我已经困扰了很长时间。 问题很简单,即:我有一个具有特定尺寸 (450x800px) 的区域,我希望该区域始终适合屏幕的高度。

我在此附上我正在编写的示例代码,非常感谢能帮助我的人!

<!DOCTYPE html>
<html>
<head>
     <Meta name="viewport" content="height=device-height,initial-scale=1.0">
<title>Page Title</title>
<style>
html,body {  height: 100%;  margin: 0;}
.full-height {  height: 100%;  background: yellow;}
</style>
</head>
<body>
<div class="full-height">
    <div style="width:450px; height:800px; margin-left:auto; margin-right:auto; background-color:#FD0F13">I am a DIV that will stretch to fit the whole width and height of the browser window!</div>
</div>
</body> </html>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)