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; ...
随机推荐
- Pintos-斯坦福大学操作系统Project详解-Project1
转载请注明出处. 前言: 本实验来自斯坦福大学cs140课程,只限于教学用途,以下是他们对于Pintos系统的介绍: Pintos is a simple operating system fra ...
- 【随记】还原SQL Server数据库步骤
情景:在一台机器上备份数据库,然后在另一台机器上还原数据库,可能会出现错误提示:System.Data.SqlClient.SqlError: 备份集中的数据库备份与现有的 'XXX' 数据库不同. ...
- List<Map<String, Object>>相关
2016年8月6日13:53:00 --------------------------- List<Map<String, Object>> List集合新增列 则需要: L ...
- mysql慢速查询
linux下配置慢查询: 修改my.cnf文件,在[mysqld]模块下添加 #slow_query_log=1 有些人说这个是slow_query的开关,但是我加上以后提示错误.log_slow_q ...
- java执行机制
java代码编译是由Java源码编译器来完成,流程图如下所示: Java字节码的执行是由JVM执行引擎来完成,流程图如下所示: Java代码编译和执行的整个过程包含了以下三个重要的机制: Java源码 ...
- iOS: 学习笔记, swift扩展
// // YYExtension.swift // // Created by yao_yu on 14-7-18. // Copyright (c) 2014年 yao_yu. All right ...
- service httpd restart失败解决方法(小记)
1.首先查看错误日志 /var/log/message看看具体问题.如果一时难以判定直接使用下面一招 2.直接中断http服务,killall -9 httpd, 然后重启http,service ...
- Start of Something New
Hi Guys This will be the blog of SCaffrey for some time before he creates his own site:) Have a nice ...
- BZOJ 4013 实验比较
Description 小D被邀请到实验室,做一个跟图片质量评价相关的主观实验.实验用到的图片集一共有\(N\)张图片,编号为\(1\)到\(N\).实验分若干轮进行,在每轮实验中,小\(D\)会被要 ...
- iReport中求和的问题
数据库取出值TAX_AMT,但是不想在数据库里面计算,太麻烦,后面group by 字段太多.那就放到ireport里面去计算咯 在字段的如下位置进行计算吧.