1、头部和底部固定,中间内容滚动,不涉及fixed

1)absolute与height:100%

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <title></title>
  <style>
    html{height: 100%;}
    body{padding:0px;margin:0px;overflow: hidden;height: 100%;}
    header{height: 50px;line-height: 50px;background: red;text-align: center;}
    section{height: 100%;overflow-y: auto;}
    .content{padding-bottom: 100px;}
    footer{height: 50px;line-height: 50px;background: red;position: absolute;width: 100%;bottom: 0px;text-align: center;}
  </style>
</head>
<body>
  <header>我是头部</header>
  <section>
    <div class="content"></div>
  </section>
  <footer>我是底部</footer>
</body>
</html>

2) flex与 height: 100vh

<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
body {
  margin: 0px;
  padding: 0px;
}
.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
header {
  height: 50px;
  line-height: 50px;
  background: #ddd;
  text-align: center;
}
section {
  overflow-y: auto;
}
footer {
  height: 50px;
  line-height: 50px;
  background: #ddd;
  width: 100%;
  text-align: center;
}
</style>
</head>
<body>
  <div class="main">
    <header class="main_1">我是头部</header>
    <section class="main_1">
      <div class="content">
        <div>11111111111</div>
      </div>
    </section class="main_1">
    <footer>我是底部</footer>
  </div>
</body>
2、如果是使用ionic框架,用其自带组件
     <ion-fab></ion-fab>

解决fixed在苹果手机抖动问题/头部底部固定布局的更多相关文章

  1. 解决安卓手机input获取焦点时会将底部固定定位按钮顶起的问题

    一个页面上有个固定在底部的按钮,页面中有个input框,点击input框获取焦点时,在苹果手机上没事,但在安卓手机上弹出的键盘会将按钮顶起来,这就很不好看了,想了个办法解决一下.之前一直觉得用inpu ...

  2. 在safari上,解决fixed失效问题

    一个页面中有头部.底部和中间内容区域,底部固定在屏幕底端. 头部header 内容main 底部footer 方法一.在main上使用fixed定位,加上overflow-y属性. .main { p ...

  3. ListView在列表的头部和底部添加布局——addHeaderView,addFooterView

    addHeaderView()方法:主要是向listView的头部添加布局addFooterView()方法:主要是向listView的底部添加布局 以addHeaderView为例: View he ...

  4. 【微信小程序】view顶部固定或底部固定 + scroll-view中的元素view也可以使用position:fixed;固定选中元素位置

    1.顶端固定核心代码如下: <view class="page__hd" style="position:fixed; top:0;width: 750rpx;&q ...

  5. 微信小程序之顶部固定和底部固定

    顶部固定 <view style="position:fixed;top:0;"> ...... </view> 底部固定 <view style=& ...

  6. jQuery&CSS 顶部和底部固定浮动工具栏 兼容IE6

    http://www.cnblogs.com/lhj588/archive/2013/04/02/2994639.html —————————————————————————————————————— ...

  7. css3 的 calc()函数在布局中的使用----头部高度固定,页面正好占满一屏

    最近项目遇到一个布局需求,头部高度固定,页面需要刚好占满一屏幕. 如下示意图: 方法:使用calc .wrap{ position: relative; margin-left: 24px; marg ...

  8. Android 仿QQ首页的消息和电话的切换,首页的头部(完全用布局控制)

    Android 仿QQ首页的消息和电话的切换,首页的头部(完全用布局控制) 首先贴上七个控制布局代码 1.title_text_sel.xml 字体颜色的切换 放到color文件夹下面 <?xm ...

  9. 解决 scroll() position:fixed 抖动、导航菜单固定头部(底部)跟随屏幕滚动

    一.导航栏或者页脚正常情况下固定在页面的相应位置,当页面滚动后,导航栏或者页脚固定在页面的顶部或者底部的情景 一般就是将该块的代码样式的position设置为fixed.固定在顶部的话,将top设置为 ...

随机推荐

  1. [Algorithm] Determine if two strings are an anagram

    The anagram test is commonly used to demonstrate how an naive implementation can perform significant ...

  2. 躁动不安的const

    就是用来恐吓你的 我能想到的,最短的.且const最多的一个语句是: int const * fun(int const*const a[],const int index)const; 而这个语句还 ...

  3. scanner使用中遇见的问题

    近期在学习的过程中遇见一个问题,问题不难但还是须要去认真对待. 先看看我写的源码 public static void main(String[] args){ for(;;){ Scanner in ...

  4. 异步POST请求解析JSON

    异步POST请求解析JSON 一.创建URL NSURL *url = [NSURL URLWithString:@"http://localhost:8080/MJServer/order ...

  5. charts柱状图,定时刷新

    option: var dataoptionone = { title : { text: '数据存储情况', subtext: '数据表', x:'center' }, tooltip: { sho ...

  6. Unix域套接字(Unix Domain Socket)介绍【转】

    本文转载自:http://blog.csdn.net/roland_sun/article/details/50266565 版权声明:本文为博主原创文章,未经博主允许不得转载. 在Linux系统中, ...

  7. WebSocket握手总结

    网址:http://blog.csdn.net/edwingu/article/details/44040961 WebSocket protocol 是HTML5一种新的协议.它实现了浏览器与服务器 ...

  8. 异常值检测(Detecting Outliers)

    Most statistical approaches to outlier detection are based on building a probability distribution mo ...

  9. Webservice 的安全策略

      摘自:http://www.cnblogs.com/shengel/archive/2008/11/20/1337723.html   Webservice为作为方便的服务被用广大领域使用的同时, ...

  10. 创建APP检查更新页

    本文来源及参考:Create a check for updates page for your app. 这篇文章解释了如何创建一个简单的检查更新页,检查该用户已安装的应用程序的最新版本. 简介 这 ...