移动WEB—如何解决当header和footer的fixed布局的方法

1、html代码

 1  <body>
 2      <div class="header">
 3      </div>
 4
 5      <!-- header占位元素 -->
 6      <div class="header-place"></div>
 7      <!-- header占位元素-end -->
 8
 9      <div class="container">
10      </div>
11
12      <!-- footer占位元素 -->
13      <div class="footer-place"></div>
14      <!-- footer占位元素-end -->
15
16      <div class="footer">
17      </div>
18  </body>

2、scss(sass)代码

 1 $header_height:4rem;
 2 $footer_height:5rem;
 3
 4 .header{
 5     width: 100%;
 6     height: $header_height;
 7     line-height: $header_height;
 8     position:fixed;
 9     z-index:999;
10 }
11
12 .header-place{
13     width: 100%;
14     height: $header_height;
15     line-height: $header_height;
16 }
17
18 .footer{
19     width: 100%;
20     height: $footer_height;
21     position: fixed;
22     z-index:999;
23 }
24
25 .footer-place{
26     width: 100%;
27     height: $footer_height;
28 }
时间: 2024-08-07 17:01:19

移动WEB—如何解决当header和footer的fixed布局的方法的相关文章

你必须了解的RecyclerView的五大开源项目-解决上拉加载、下拉刷新和添加Header、Footer等问题

前段时间做项目由于采用的MD设计,所以必须要使用RecyclerView全面代替ListView.但是开发中遇到了需要实现RecyclerView上拉加载.下拉刷新和添加Header以及Footer等需求问题,现将问题解决中用到的五大开源项目总结下来,方便他人. 首先介绍下RecyclerView,RecyclerView相比ListView增加了很多新特性: ? Adapter中的ViewHolder模式 - 对于ListView来说,通过创建ViewHolder来提升性能并不是必须的.因为L

css解决无论页面长短footer永远置底

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Typ

easy Html5 - Jquery Mobile之ToolBars(Header and Footer)

jquery 在web js框架上的风暴还在继续却也随着移动终端走向了mobile:那么jquery mobile到底包括些什么呢 简介工具栏是在移动网站和应用中的头部,尾部或者内容中的工具条:Jquery Mobile提供了一套标准的工具和导航栏的工具,可以在绝大多数情况下直接使用:头部一般做网站或应用的标题,功能导航等,一般都是些文字或者按钮:尾部是一个页面的最下端,内容可以根据具体应用需要来排版,也可以放功能导航.各种链接等:内容中使用一般是作为功能的展示,显示内容同时附带着功能:jque

html5新特性-header,nav,footer,aside,article,section等各元素的详解

Html5新增了27个元素,废弃了16个元素,根据现有的标准规范,把HTML5的元素按优先级定义为结构性属性.级块性元素.行内语义性元素和交互性元素四大类. 下面是对各标签的详解,section.header.footer.nav.article.aside.figure.code.dialog.meter.time.progress.video.audio.details.atagrid.menu.command的 介绍 结构性元素主要负责web上下文结构的定义 <section>:在 we

UICollectionView Header 和Footer

@interface FooterView : UICollectionReusableView Footer  和 Header  基于  UICollectionReusableView 重用标识 static NSString * headeridentifier = @"header";static NSString * footeridentifier = @"FOOTER"; 注册重用标识符 第一个参数 : 返回的view类型     第二个参数: 设置

delphi xe6 android ListView增加 Header或Footer 的方法

var  Item1: TListViewItem;begin    Item1 := ListView1.Items.Add;    Item1.Purpose:=TListItemPurpose.Header;//    Item1.Purpose:=TListItemPurpose.Footer;    Item1.text:=' xxxx';//Header或Footer显示的内容end; delphi xe6 android ListView增加 Header或Footer 的方法,布

CollectionView Header And Footer 的使用

CollectionView Header And footer 的添加和设置 建议先看CollectionView 第一篇:http://www.jianshu.com/p/a1614404ae96 注册Header 和 Footer p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #008400 } p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px M

精通CSS:高级Web标准解决方式(第2版)

精通CSS:高级Web标准解决方式(第2版) 跳转至: 导航. 搜索 层叠重要度:(也就是说.用户!important能够覆盖inline style) !important.用户>作者.最后是浏览器/用户代理 规则特殊性(次序)的计算:a,b,c,d 假设同样.后定义的优先 假设是inline style,a=1 b=ID选择器(#id)的个数 c=类.伪类.属性选择器的个数 d=类型.伪元素选择器的个数 => 大站点复杂内容情况下怎样管理规则次序??? @import比link慢? p41

怎样在UICollectionView中添加Header和footer

---恢复内容开始--- 怎样在UICollectionView中添加Header和footer 转载于http://my.oschina.net/zboy/blog/221525 摘要 来自-http://www.appcoda.com/supplementary-view-uicollectionview-flow-layout/ iOS UICollectionViewController 目录[-] Tweak the Margin of Your Content using Secti