div页面居中(上下左右)
| <!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-Type" content="text/html; charset=utf-8"> | |
| <title>Special Layout</title> | |
| <style type="text/css"> | |
| html, body { | |
| width: 100%; | |
| height: 100%; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| body { | |
| } | |
| #wrapper { | |
| position: relative; | |
| top: 10%; | |
| margin: 0 auto; | |
| width: 80%; | |
| min-width: 400px; | |
| height: 80%; | |
| background: #000; | |
| } | |
| #left { | |
| float: left; | |
| position: relative; | |
| width: 200px; | |
| height: 100%; | |
| margin-right: -200px; | |
| background: blue; | |
| overflow: hidden; | |
| } | |
| #right { | |
| position: relative; | |
| width: auto; | |
| height: 100%; | |
| background: green; | |
| margin-left: 200px; | |
| overflow: hidden; | |
| } | |
| #lefttop { | |
| width: 100%; | |
| height: 100px; | |
| background: red; | |
| } | |
| #leftbottom { | |
| width: 100%; | |
| background: #0ff; | |
| height: auto !important; | |
| height: 9999px; | |
| } | |
| #left>#leftbottom { | |
| position: absolute; | |
| top: 100px; | |
| bottom: 0; | |
| } | |
| #righttop { | |
| width: 100%; | |
| height: 100px; | |
| background: #f0f; | |
| } | |
| #rightbottom { | |
| width: 100%; | |
| background: #ff0; | |
| height: auto !important; | |
| height: 9999px; | |
| } | |
| #right>#rightbottom { | |
| position: absolute;; | |
| top: 100px; | |
| bottom: 0; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="wrapper"> | |
| <div id="left"> | |
| <div id="lefttop">lefttop</div> | |
| <div id="leftbottom">leftbottom</div> | |
| </div> | |
| <div id="right"> | |
| <div id="righttop">righttop</div> | |
| <div id="rightbottom">rightbottom</div> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |
div页面居中(上下左右)的更多相关文章
- jquery鼠标移动div内容上下左右滚动
jquery鼠标移动div内容上下左右滚动 点击这里查看效果:http://keleyi.com/keleyi/phtml/jqtexiao/9.htm <!DOCTYPE html PUBLI ...
- div元素上下左右居中
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- css超简单实现div页面居中【适合做弹出框】
1.前言 现在项目中用到弹出框的话大部分都是直接用控件的.不过有控件虽方便,但有时候会有冲突的地方.我上次用layui的弹出框控件,然后也用到了百度的编辑器uEditor,然后一切都好好的,结果编辑赋 ...
- div层上下左右居中
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 多行文字在一个div中上下左右居中
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- css div图片上下左右居中
<style type="text/css"> div{border:1px solid #ccc;height:500pc;width:500px;text-alig ...
- div内容上下左右居中
<!-- 遮罩层 --> <div id="test" > <div style="position:absolute;top:50%;le ...
- 使一个div元素上下左右居中
第一种方法 浮动流自我调节 .box{ widht:200px; height:200px; position:relative; } .box .son{ width:100px; height:1 ...
- 一个Div在BOdy中上下左右居中
在body中让一个DIv居中 上下左右 <body> <div style=" width:800px; height:500px; position:absolute; ...
随机推荐
- 【JAVA集合】HashMap源码分析(转载)
原文出处:http://www.cnblogs.com/chenpi/p/5280304.html 以下内容基于jdk1.7.0_79源码: 什么是HashMap 基于哈希表的一个Map接口实现,存储 ...
- 插入标记 方法 insertAdjacentHTML
html5新增的插入标记方法,insertAdjacentHTML() 可以接受2个参数 插入位置和要插入的 HTML 文本.第一个参数必须是下列值之一: "beforebegin" ...
- Touch组件实现原理
Touch组件的实现主要解决了在pc端和移动端拖拽元素的功能. PC端: 依靠事件: mousedown,mousemove,mouseup的鼠标事件.过程: 1. mousedown事件中记录当前元 ...
- JS判断浏览器类型以及版本号
<script type="text/javascript"> (function(){ window.nav={}; ...
- MySQL驱动阅读------executeQuery查询的过程,基于JDBC-----5.1.26
Statement statement = connection.createStatement(); final ResultSet resultSet = statement.executeQue ...
- Python抓取双色球数据
数据来源网站http://baidu.lecai.com/lottery/draw/list/50?d=2013-01-01 HTML解析器http://pythonhosted.org/pyquer ...
- bzoj 2331: [SCOI2011]地板 插头DP
2331: [SCOI2011]地板 Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 541 Solved: 239[Submit][Status] D ...
- MySQL协议简单分析
tcpdump -i eth0 -s0 -l -w - port 3306|strings|grep -i -E 'select|update|insert|delete|set'
- MFC 仿QQ聊天软件(黄花寒)
http://blog.csdn.net/lh844386434/article/details/6655080 http://download.csdn.net/download/lh8443864 ...
- 有感,懂市场比懂产品重要,懂产品比懂技术重要——想起凡客诚品和YY语音了
一个创业公司,最好三样都要有,但应该CEO是懂市场,经理懂产品,程序员最好懂技术厉害一点-这还不算,销售也要厉害一点,不能守株待兔- 美工——有钱最好请个美工,最起码也要请人设计修改一下- 财务——不 ...