布局解决方案之全屏布局
来源:互联网 发布:网络中数据包流动图 编辑:程序博客网 时间:2024/06/05 18:51
前端布局非常重要的一环就是页面框架的搭建,而在页面框架的搭建之中,居中布局、多列布局、全局布局是非常重要的一环,今天我们就来总结总结前端干货之布局的解决方案。
part 3:全屏布局
一、何为全屏布局
二、全屏布局的特点
- 浏览器变大时,撑满窗口
- 滚动条不是全局滚动条,而是出现在内容区域里,往往是主内容区域
三、全部平局的方法
方法一 position
<div class="parent"> <div class="top">top</div> <div class="left">left</div> <div class="right"> <div class="inner">right</div> </div> <div class="bottom">bottom</div></div>
html,body,.parent{ margin:0; height:100%; overflow:hidden;}body{ color:white;}.top{ position:absolute; top:0; left:0; right:0; height:100px; background:blue;}.left{ position:absolute; left:0; top:100px; bottom:50px; width:200px; background:red;}.right{ position:absolute; left:200px; top:100px; bottom:50px; right:0; background:pink; overflow: auto;}.right .inner{ min-height: 1000px;}.bottom{ position:absolute; left:0; right:0; bottom:0; height:50px; background: black;}
- 优点:兼容性好,ie6下不支持
方法二 flex
<div class="parent"> <div class="top">top</div> <div class="middle"> <div class="left">left</div> <div class="right"> <div class="inner">right</div> </div> </div> <div class="bottom">bottom</div></div>
html,body,.parent{ margin:0; height:100%; overflow:hidden;}body{ color: white;} .parent{ display: flex; flex-direction: column;}.top{ height:100px; background: blue;}.bottom{ height:50px; background: black;}.middle{ flex:1; display:flex;}.left{ width:200px; background: red;}.right{ flex: 1; overflow: auto; background:pink;}.right .inner{ min-height: 1000px;}
- 缺点:兼容性差,ie9及ie9以下不兼容
方法 flex
<div class="parent"> <div class="top">top</div> <div class="middle"> <div class="left">left</div> <div class="right"> <div class="inner">right</div> </div> </div> <div class="bottom">bottom</div></div>
html,body,.parent{ margin:0; height:100%; overflow:hidden;}body{ color:white;} .parent{ display:flex; flex-direction:column;}.top{ background:blue;}.bottom{ background:black;}.middle{ flex:1; display:flex;}.left{ background: red;}.right{ flex:1; overflow:auto; background: pink;}.right .inner{ min-height:1000px;}
四、总结
阅读全文
0 0
- 布局解决方案之全屏布局
- css--全屏布局解决方案
- 布局解决方案之居中布局
- 全屏布局
- 布局全屏
- 全屏布局
- 全屏布局
- 布局解决方案-居中布局
- 布局解决方案
- div 全屏自适应 布局
- ExtJs全屏布局
- 布局,全屏,横屏竖屏
- Android之全屏下软键盘弹出布局移动问题
- 响应式布局解决方案之Media Query
- 布局解决方案之多列布局
- Android开发 之 全屏显示布局(相关主题,状态栏,布局填充)
- 去掉ios7的全屏布局
- 去掉ios7的全屏布局
- [安卓学习笔记]----意图
- C语言——第一部分 C语言概述以及编程基础
- 布局解决方案之居中布局
- Linux C编程学习笔记(2):open、creat、close函数及文件的创建、打开与关闭
- 布局解决方案之多列布局
- 布局解决方案之全屏布局
- 次方求模
- C#中数组Array、ArrayList、泛型List<T>的比较
- C#中字典集合HashTable、Dictionary、ConcurrentDictionary三者区别
- Axon Framework在聚合中处理命令
- 苹果CMS(maccms)模板中最新和最热分类显示处理方式
- 『AngularJS』$location 服务
- nRF51822低功耗CPU睡眠软件应用
- Intellij main方法