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; ...
随机推荐
- 博客系统-3.0CodeIgniter系统SAE版本的配置 application/config/
autoload.php(系统启动时自动加载的文件:包,类库,驱动,方法助手,配置) $autoload['libraries'] = array('database', 'access', 'pag ...
- core文件找不到了
开始以为是core文件太大,设置ulimit -c unlimited 以后,再次访问,显示 ./a.out Segmentation fault (core dumped) 但是却找不到这个文件的 ...
- c++中的vector原理
vectorvector就是动态数组.它也是在堆中分配内存,元素连续存放,有保留内存,如果减少大小后,内存也不会释放.如果新值>当前大小时才会再分配内存. 它拥有一段连续的内存空间,并且起始地址 ...
- ASP.NET MVC轻教程 Step By Step 9——分页
现在我们要把Index视图的留言信息进行分页显示. Step 1. 创建路由 我们希望以类似地址http://localhost:41583/Page1来表示第一页,Page2表示第二页,以此类推.在 ...
- 一张图看懂DNS域名解析全过程
DNS域名解析是互联网上非常重要的一项服务,上网冲浪(还有人在用这个词吗?)伴随着大量DNS服务来支撑,而对于网站运营来说,DNS域名解析的稳定可靠,意味着更多用户的喜欢,更好的SEO效果和更大的访问 ...
- bzoj 1031: [JSOI2007]字符加密Cipher 後綴數組模板題
1031: [JSOI2007]字符加密Cipher Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 3157 Solved: 1233[Submit ...
- Ubuntu版本介绍
转自Ubuntu版本介绍 经常有人问起Ubuntu的版本选择问题,论坛中虽有帖子提及,但不是很详细,不集中,我就尝试把Ubuntu上的这点东东翻译一下,供大家参考,水平有限,敬请包涵.指正. Ubu ...
- xstream 别名的用法<转>
1.xstream的alias使用方法: 1.1 作用:将序列化中的类全量名称,用别名替换. 1.2 使用方法:xstream.alias("blog", Blog.class) ...
- EditText的 焦点事件 setOnFocusChangeListener
实现代码: //光标处在EditText时其内容消失 mInfo = (EditText)findViewById(R.id.old_password); //setOnFocusChangeList ...
- lc面试准备:Reverse Bits
1 题目 Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represente ...