响应式布局实例
来源:互联网 发布:网易我的世界手机版js 编辑:程序博客网 时间:2024/05/29 13:11
静态布局
意思就是只是针对某个屏幕下设计的网页,当屏幕大小改变时,页面布局不会发生变化,就像经常所看到的滚动条。
自适应布局
特点是分别为不同的屏幕设置布局格式,当屏幕大小改变时,会出现不同的布局,意思就是在这个屏幕下这个元素块在这个地方,但是在那个屏幕下,这个元素块又会出现在那个地方。只是布局改变,元素不变。可以看成是不同屏幕下由多个静态布局组成的。
流式布局
特点是随着屏幕的改变,页面的布局没有发生大的变化,可以进行适配调整,这个正好与自适应布局相补。
响应式布局
这个就好理解了,意思就是分别为不同的屏幕设计的布局方式,可以理解成自适应布局和流程布局的结合。
结合上述文字描述,再观察如下的页面实际效果,应该可以把这几个概念搞清楚:http://wow.techbrood.com/fiddle/1753
响应式布局实例:
html:
<!DOCTYPE html><html><head> <title>响应式布局-样式表中内嵌法</title> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/main.css"></head><body><div class="header">header</div><div class="container"> <div class="sidebarLeft">sidebarLeft</div> <div class="main">main</div> <div class="sidebarRight">sidebarRight</div></div><div class="footer">footer</div></body></html>
main.css:
转载自:http://blog.csdn.net/rootes/article/details/23761365* { margin: 0; padding: 0;}body { font: 18px/20px "Microsoft YaHei", arial, serif; color: #fff; background: #fff;}img { border: 0;}a { text-decoration: none;}.header,.container,.footer { margin-left: auto; margin-right: auto; margin-top: 10px; text-align: center;}.header { height: 100px; background: #333;}.sidebarLeft,.main,.sidebarRight { background: #333;}.footer { height: 100px; background: #333;}@media screen and (min-width: 960px) { .header, .container, .footer { width: 960px; } .sidebarLeft, .main, .sidebarRight { float: left; height: 400px; } .sidebarLeft, .sidebarRight { width: 200px; } .main { margin-left: 10px; margin-right: 10px; width: 540px; } .container { height: 400px; }}@media screen and (min-width: 600px) and (max-width: 960px) { .header, .container, .footer { width: 600px; } .sidebarLeft, .main { float: left; height: 400px; } .sidebarRight { display: none; } .sidebarLeft { width: 160px; } .main { margin-left: 10px; width: 430px; } .container { height: 400px; }}@media screen and (max-width: 600px) { .header, .container, .footer { width: 400px; } .sidebarLeft, .sidebarRight { width: 400px; height: 100px; } .main { margin-top: 10px; width: 400px; height: 200px; } .sidebarRight { margin-top: 10px; } .container { height: 420px; }}/*//完整版.header,.container,.footer{ margin-left:auto; margin-right:auto; width:960px; margin-top:10px; text-align:center;}.header{ height:100px; background:#333;}.sidebarLeft,.main,.sidebarRight{ background:#333; float:left; height:400px;}.sidebarLeft,.sidebarRight{ width:200px;}.main{ margin-left:10px; margin-right:10px; width:540px;}.container{ height:400px;}.footer{ height:50px; background:#333;}*/
http://caibaojian.com/356.html
0 0
- 响应式布局实例
- CSS响应式布局实例
- CSS响应式布局实例
- 典型的响应式布局实例代码
- css3 flex流动自适应响应式布局实例2
- html css rem响应式页面布局实例
- [响应式布局]响应式布局技巧
- 响应式布局入门
- 响应式布局原理
- 响应式布局入门
- 响应式布局入门
- 响应式布局入门
- 浅谈响应式布局
- 响应式布局
- 响应式布局
- 浅谈响应式布局
- 实现响应式布局
- 浅谈响应式布局
- sql不走索引总结(多看多记住啊)
- JRebel For Idea 乱码
- 在ubuntu中安装android studio环境
- python 处理csv文件的过程对换行符的处理
- Kioskcached(2) 之 使用tcmalloc 替换 ptmalloc
- 响应式布局实例
- cocos2d小型工程的代码组织结构
- mac下的常用命令
- swift实现圆角的设置
- Servlet-登录Demo
- ubuntu14.04 安装openresty
- Spirng学习笔记之bean和BeanFactory(二)
- 常用的推荐算法
- 将file类型的文件转换为blob,将blob类型转换为file