可扩展性的页面布局
来源:互联网 发布:网易域名邮箱注册 编辑:程序博客网 时间:2024/06/06 00:00
下面我在总结一下一般的三种扩展布局,这儿所示的扩展布局很常规,有的童鞋会说使用column或者flex啥的布局不是很方便吗,但是你也要看它的支持程度吧,比如你在手机端使用,那当然很好,那我要兼容IE8,IE9呢?
1.左右结构,左边100%;右边宽度固定
HTML代码:
<div id="header"></div><div id="center"> <div id="main_wrapper"> <div id="main"></div> </div> <div id="sidebar"></div></div><div id="footer"></div>
#header{height:80px; background:#CCC;}#center{overflow:hidden; zoom:1;}#main_wrapper{float:left; width:100%; margin-top:10px; margin-left:-210px;}#main{height:200px; margin-left:210px; background:#999;}#sidebar{float:right; width:200px; margin-top:10px; height:200px; background:#AAA;}#footer{height:50px; margin-top:10px; background:#CCC;}
2.左右结构,左边固定,右边100%
<div id="header"></div><div id="center"> <div id="sidebar"></div> <div id="main_wrapper"> <div id="main"></div> </div></div>
css代码:
#header{height:80px; background:#CCC;}#center{overflow:hidden; zoom:1;}#sidebar{float:left; width:200px; margin-top:10px; height:200px; background:#AAA;}#main_wrapper{float:right; width:100%; margin-top:10px; margin-left:-210px;}#main{height:200px; margin-left:210px; background:#999;}#footer{height:50px; margin-top:10px; background:#CCC;}
3.左中右结构,左边固定,右边固定,中间100%
HTML代码:
<div id="header"></div><div id="center"> <div id="sidebar-l">这里是左边</div> <div id="main-wrapper"> <div id="main">这里是中间</div> </div> <div id="sidebar-r">这里是右边</div></div><div id="footer"></div>
css代码:
#header{height:80px; background:#CCC;}#center{overflow:hidden; zoom:1;}#sidebar-l {float:left; width:200px; margin-top:10px; height:200px; background:#AAA;}#main-wrapper {margin-top:10px; float:left; width:100%; margin-left:-420px; height:200px;}#main {margin-left:438px; background:#999; height:200px;}#sidebar-r {float:right; width:200px; margin-top:10px; height:200px; background:#AAA;}#footer{height:50px; margin-top:10px; background:#CCC;}
阅读全文
0 0
- 可扩展性的页面布局
- 两种页面滑动门的效果,具备可扩展性
- HANA的可扩展性
- java的可扩展性
- 可扩展性程序的提纲
- Facebook的可扩展性体系结构
- 什么是系统的可扩展性?
- 基于spring的可扩展性
- 可扩展性
- 关于可扩展性专题的研究
- 搜索引擎中Spider的可扩展性设计
- 可扩展性构建灵活系统的思考
- 什么叫系统的可扩展性?
- 集群的可扩展性及其分布式体系结构
- web运维的可扩展性考虑
- 可扩展性的hash算法和系统
- 可扩展性的hash算法和系统
- 可扩展性数据库的架构设计
- JavaScript块级作用域与函数作用域
- jquery操作复选框(checkbox)的方式
- 【GDOI2018模拟8.14】神奇的矩阵
- 无人机项目获取用户信息并进行用户信息修改的angularjs部分
- 玩转spring boot——简单登录认证
- 可扩展性的页面布局
- 模板_Dinic算法
- eclipse上传项目到GitHub上
- 企业级架构师应该向谁汇报工作?
- [EMNLP2015]Effective Approaches to Attention-based Neural Machine Translation
- Cython 入门:helloworld
- Spring设值注入
- Android电视应用首页开发以及效果展示
- maven项目生成war包,发布tomcat服务器报错,问题解决