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. 1. 少了一个PermMissingElem Find the missing element in a given permutation.

    少了一个: package com.code; import java.util.Arrays; public class Test03_2 { public static int solution( ...

  2. FTP用户-禁止登录系统

    OS是Ubuntu 11.10. 1.   which nologin #/usr/sbin/nologin 2.   vim /etc/shells   #在该文件后添加/usr/sbin/nolo ...

  3. [JavaEE] Injecting Bean

    So what is a Bean, in JavaEE, any class expect Entity are Bean. One usefully thing in Bean is Depend ...

  4. [Vue @Component] Pass Props to Vue Functional Templates

    Functional templates allow you to create components consisting of only the template tag and exposing ...

  5. [Vue-rx] Pass Template Data Through domStreams in Vue.js and RxJS

    domStreams enable you to pass additional data along the stream that can be provided by the template ...

  6. 【转】MySQL随机字符串生成

    DROP FUNCTION IF EXISTS rand_string; DELIMITER $$ CREATE FUNCTION rand_string(str_length TINYINT UNS ...

  7. FourCC

    https://en.wikipedia.org/wiki/FourCC A FourCC (literally, four-character code) is a sequence of four ...

  8. tiny4412 裸机程序 六、重定位代码到IRAM+0x8000【转】

    本文转载自:http://blog.csdn.net/eshing/article/details/37115697 一.重定向 对于程序而言,我们需要理解两个概念,一是程序当前所处的地址,即程序在运 ...

  9. Modular_exponentiation模幂运算

    https://en.wikipedia.org/wiki/Modular_exponentiation 蒙哥马利(Montgomery)幂模运算是快速计算a^b%k的一种算法,是RSA加密算法的核心 ...

  10. Android开发中常用的一些小技巧(转载)

    http://www.jb51.net/article/61135.htm Activity.startActivities() 常用于在应用程序中间启动其他的Activity. TextUtils. ...