标题,容器,页脚需要适合任何分辨率而不需要滚动条

时间:2016-10-05 05:41:26

标签: jquery html css responsive-design

这是我的fiddle,标题,容器,页脚需要适合任何分辨率而不使用滚动条,或者有没有办法在不使用固定位置的情况下执行此操作

img {
  width: 100%;
}
.content {
  background: yellow;
}
footer {
  height: 40px;
  background: #000;
  width: 100%;
  color: #fff;
  position: fixed;
  bottom: 0px;
}
<header class="header">
  <img src="http://www.emedicalpoint.com/images/nav/sprite.jpg" alt="">
</header>
<div class="content">
  <p>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  </p>
</div>
<footer>
  footer content comes here
</footer>

1 个答案:

答案 0 :(得分:0)

  1. <head>代码中添加此viewport meta tag

    <meta name="viewport" content="width=device-width">
    

    这应该使页面呈现合理的大小。

  2. <style>代码中添加此<head>代码:

    <style>
    img {
        max-width: 100%;
    }
    </style>
    

    认为这将确保所有图片都不会呈现比应用程序的webview视口更宽的范围。