<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>absolute模拟fixed</title><!-- Sets initial viewport load and disables zooming  --><meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"><!-- Makes your prototype chrome-less once bookmarked to your phone's home screen --><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><style>html,
body{height:100%;margin:0;padding:0;}
header,footer{height:40px; text-align:center; position:absolute; width:100%; line-height:40px; background:#fff; z-index:2;}
header{border-bottom:1px solid #ccc;top:0;}
footer{border-top:1px solid #ccc;bottom:0;}
h1{margin:0; }
.content{position:absolute;top:40px;left:0;right:0;bottom:40px; box-sizing:border-box;overflow-y:auto;-webkit-overflow-scrolling:touch;}</style></head><body><!-- Make sure all your bars are the first things in your <body> --><header class="bar bar-nav"><h1 class="title">header</h1></header><!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) --><div class="content"><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2><input /></h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content</h2><h2>content-last</h2></div><footer class="bar bar-footer"><h1 class="title">footer</h1></footer></body>
</html>

转载于:https://blog.51cto.com/456508/1568636

移动页面框架头尾固定中间滚动 absolute模拟fixed相关推荐

  1. CSS绝对定位模拟固定定位(absolute模拟fixed)

    滚动条的产生 滚动条在谁身上 初始包含块 <!DOCTYPE html> <html><head><meta charset="UTF-8" ...

  2. html怎么制作固定背景,使用CSS制作的页面背景固定和滚动效果

    HTML HTML结构很简单,一个class为.cd-fixed-bg的div元素用于放置固定背景图,一个class为.cd-scrolling-bg的div元素用于滚动的部分.我们可以放置多个.cd ...

  3. vue、html 实现头尾固定,中间滚动的布局(移动端常见的布局)

    前言: 头尾固定,中间滚动的布局,这种布局很常见,移动端.pc端都常见.不过移动端居多. 实现过程: html实现过程 其实就是 一个盒子里面三个 部分 头,身体,脚 . 身体 的高度需要 减去 头和 ...

  4. html页面左右滑动固定插件,jQuery全屏滚动插件fullPage.js让你的页面分屏滚动

    随着扁平化风格的日益流行,越来越多的网页越来越简单但又看上去高大上,比如小米.魅族.苹果等等知名站点的新品页面,以及360.百度等网站的专题页面越来越采用分屏滚动的风格. 当然实现这种风格的方法有多种 ...

  5. table固定表头滚动

    一.table固定表头滚动(不兼容IE)  使用scrollTop监听滚动   如下例 1.html <div class="tabflow" id="flowta ...

  6. Razor的主版页面框架

    类似于2.0版本中的MasterPage主版页面框架,不过mvc3.0推出的RazorView内建的主版页面语法与原本的webFormview的MasterPage相差甚远 1,Razor的页面执行顺 ...

  7. flex布局实现头尾固定,中间内容自适应

    头尾固定,中间区域可以滑动效果是移动端最常见的效果,以京东页面为例.以前开发时常用的方法是用固定布局 position: fixed; 实现,但是该方法在 ios 上或者其他机型上会出现问题.现在,可 ...

  8. Vue中el-table追加行后固定列滚动错位问题

    Vue中el-table追加行后固定列滚动错位问题 一.问题描述 偶然发现一个问题,但是并没有找到解决方案,自己调试了两个多小时终于解决. 先贴出问题 业务描述:在已查询完全部的符合条件的数据后,表格 ...

  9. ASP.NET母版页(Razor主版页面框架)

    本篇介绍一下 ASP.NET 中 强大的Razor语法,以及下篇我们将介绍,在Java环境中,依靠VUE组件实现此功能. Asp.NET Razor母版页介绍 ASP.NET 2.0 推出了Maste ...

  10. div+css实现表头固定内容滚动表格

    <div class="m-demo"><table><thead><tr><th>定宽a</th>< ...

最新文章

  1. python的难点_汇总Python初学者常见的学习难点
  2. 点云数据显示_vispy 显示 kitti 点云数据
  3. 【LeetCode】【HOT】39. 组合总和(回溯)
  4. [深度学习概念]·主流声学模型对比
  5. sql语句左连接时的ON AND用法
  6. 与计算机运算速度相关参数,计算机的运算速度与什么有关
  7. 中科院大学计算机科学与技术王伟强,王伟强-中国科学院大学-UCAS
  8. HCIP(华为高级网络安全工程师)(实验五)(OSPF综合实验)
  9. [MacOS] 出现 Permission denied 解决办法
  10. UCOSIII-任务管理
  11. 2022商业版游戏陪玩陪聊系统最新源码+视频教程+全套素材
  12. openwrt - 入门( uHTTPd, opkg, uci, luci, mtd等)
  13. Java如何使用直接内存?
  14. 百度回应“侵犯用户权益”;腾讯招 “巡捕大队”补贴 Q 币;硅谷将把4000亿现金转回美国丨价值早报
  15. asp.net夜话之八:数据绑定控件
  16. python如何合并excel文件
  17. oracle mysql连接池配置文件_数据库连接池两种配置方式详解
  18. 开博尔C9/M8/F2/H7/英菲克I6等_全志H8芯片_4.4.2_root_通刷_线刷固件包
  19. chrome恐龙游戏_如何在不离线的情况下玩Chrome的隐藏恐龙游戏
  20. 会议类新闻稿怎么写?附200字优秀范文案例,直接套用即可

热门文章

  1. 复杂的三元转化为if() eles()
  2. dw php重复区域横向,php横向重复区域显示二法
  3. python qq红包_numpy的Python,发红包,用
  4. Tp5.1 图片处理:缩略图+水印(换行显示)
  5. 全网首发:(解决办法)MAC OS Xcode给应用设置沙箱(Enable App Sandbox)之后,运行报错Illegal instruction: 4
  6. No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
  7. 编译OpenJDK12:valid values for --with-freetype are system and bundled
  8. 编译OpenJDK8:CreateJars.gmk/BuildJdk.gmk/Main.gmk/错误
  9. VS log4net引用错误的解决
  10. php 字母加1,PHP语法(1)