如何使html页面自动适合移动设备屏幕?

我使用< iframe>在html页面上放置了一个Formidable Form,但我希望它能在移动设备上全屏显示.到目前为止,我使用以下代码
<!DOCTYPE html>
<html>
<head>
<Meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <style>
  @import url(http://fonts.googleapis.com/css?family=Londrina+Sketch);

  body {
  background-color: #f3eedd;
  width: 750px;
  overflow:scroll;
    overflow-x:hidden;
  }

h2 {
    font-size: 20px;
    color: #c13e18;
    margin: 10px 30px 10px 30px;
}

</style>
</head>
<body>
<div id="header">
<h2>Book Supheroes Unite</h2>
</div>
<div id="form">
<iframe src="http://challenge-the-Box.com/wp-admin/admin-ajax.PHP?action=frm_forms_preview&form=sbyrt02
" frameborder="0" scrolling="no" style="width:280px;height:535px;"></iframe></div>
</html>

我相信它与视口有关?但是,我对此并不完全确定!

解决方法

<Meta name="viewport" content="width=device-width,initial-scale=1.0">

此元标记允许您定位移动设备并将宽度设置为屏幕大小.

文档提供here!

还可以考虑迁移到引导响应式网页设计的CSS框架! Twitter Bootstrap

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些