使用absolute布局
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin:0;
padding:0;
}
.top {
width: 100%;
height: 40px;
background: #000;
color:#fff;
position:absolute;
top:0;
/*以上设置是重点必须的*/
text-align:center;
line-height:40px;
}
.bottom{
width:100%;
height:40px;
background:#000;
color:#fff;
position:absolute;
bottom:0;
/*以上设置是重点必须的*/
text-align:center;
line-height:40px;
}
.mainBox{
width:100%;
position:absolute;
top:40px;
bottom:40px;
/*以上设置是重点必须的*/
}
.mainBox .leftBox{
height:100%;
width:200px;
float:left;
margin-bottom:40px;
overflow: auto;
/*以上设置是重点必须的*/
border:6px solid green;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-align:center;
line-height:40px;
}
.mainBox .rightBox{
height:100%;
margin-left:220px;
/*以上设置是重点必须的*/
border:6px solid crimson;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
overflow: auto;
text-align:center;
line-height:40px;
}
.left1{
background-color: #0088cc;
width: 100%;
height: 60%;
}
.left2{
background-color: #CCCCCC;
width: 100%;
height: 40%;
}
</style>
</head>
<body>
<div class="top">顶部,高度40px</div>
<div class="mainBox">
<div class="leftBox"><!--左盒子,固定宽度200px,高度自适应铺满屏幕剩余高度-->
<div class="left1"></div>
<div class="left2"></div>
</div>
<div class="rightBox">右盒子,距离左盒子20px,高度自适应宽度自适应铺满屏幕剩余高度</div>
</div>
<div class="bottom">底部,高度40px</div>
</body>
</html>
使用absolute布局的更多相关文章
- margin+absolute布局:右栏固定主内容自适应 demo
margin+absolute布局:右栏固定主内容自适应 demo 头部 Aside侧边栏区域 Main主内容区域 底部 #demo{width:80%;margin:auto;height:300p ...
- 一种移动端position:absolute布局:
一种移动端position:absolute布局: 1.他父级不需要加上 position:relative; 如果父级不是不是body,则加position:absolute; 2.红色加量部分 ...
- absolute布局和css布局释疑
jqueryui也不是万能的, 有时候, 也需要自己写一些, 由 css 和jquery结合的一些东西, 如: banner中, 依次播放的div等 ## 关于jquery设计的一些思想和理念?but ...
- ExtJS 布局-Absolute布局(Absolute layout)
更新记录: 2022年5月31日 发布本篇 1.说明 使用xy配置项设置子组件在父容器中绝对位置,本质是将子组件的CSS的position设置为absolute,然后使用x和y配置项映射到CSS的to ...
- absolute布局的替代实现
京东商城首页标价定位 小横条首页导航的下拉 1.京东商城首页标价定位 .p-img{ height: 130px;} .p-price{ margin:-28px 0 0 74px;} .price{ ...
- 用absolute进行页面的自适应布局
用position:absolute和top,left,bottom,right进行设置可以进行页面的头部,底部,左边框,内容的自适应布局,可以代替position:fixed; <!DOCTY ...
- HTML中的布局方式:absolute、relative、fixed、static
在CSS中关于定位的内容是: position:relative | absolute | static | fixed static(静态) 没有特别的设定,遵循基本的定位规定,不能通过z- ...
- 网页布局的应用(float或absolute)
一个浮动(左浮动或右浮动) 垂直环绕布局(float.clear) 左右两列布局(float.absolute) 三栏网页宽度自适应布局(float.absolute) 注意:网页设计中应该尽量避免使 ...
- ExtJs布局详解
序言 1.百度百科上说:ExtJs功能丰富,无人能出其右.无论是界面之美,还是功能之强,extjs都高居榜首. 2.呵呵,界面之美当是少不了布局的,这篇文章我写layout的七种布局.(extjs是4 ...
随机推荐
- Python3 tkinter基础 Frame event.x 输出鼠标左右键点击的位置
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- utf-8并不"兼容" gb2312, gb18030
注意 utf-8 并不是 向下 兼容"gb2312 gb18030"等编码, 也并不是说, utf-8就是比 gb2312等高级的编码! 比如在terminal中, 你开始使用的 ...
- cf213E 线段树维护hash
链接 https://codeforces.com/contest/213/problem/E 题目大意 给出两个排列a.b,长度分别为n.m,你需要计算有多少个x,使 得\(a_1 + x; a_2 ...
- Linux网络参数和ifconfig
目录 1.ifconfig 网络参数 2.ifup和ifdown 3.CentOS7网络配置相关文件 4.CentOS7默认网卡接口配置文件 5.补充命令 6.总结: 参考: 1.ifconfig 网 ...
- 【基本知识】Flume基本环境搭建以及原理
系统:CentOS6.5JDK:1.8.0_144Flume:flume-ng-1.6.0-cdh5.12.0 一.什么是Flume flume 作为 cloudera 开发的实时日志收集系统,受到了 ...
- 【译】第9节---EF Code First中数据注解
原文:http://www.entityframeworktutorial.net/code-first/dataannotation-in-code-first.aspx EF Code-First ...
- axios的学习与使用
最近的项目都是使用的vue框架,所以请求都使用了vue官方推荐的axios. 官方中文介绍 此处记录一下常用的写法 执行 GET 请求 // 为给定 ID 的 user 创建请求 axios.get( ...
- R 语言 Windows 环境 安装与Windows下制作R的package--Rtools
1.1 预装的软件 (所有软件都可以在 http://www.biosino.org/R/R-doc/Rm/ 和 http://www.biosino.org/R/requiredSoftWar ...
- 【Ruby】【变量】
知识点[Ruby 中$开头的全局变量.内部变量.隐藏变量介绍] Ruby 中充满了一系列的隐藏变量,我们可以从这些预定义的全局变量中获取一些有意思的信息. 全局进程变量 $$ 表示当前运行的 ruby ...
- burp suite 的intruder 四种攻击方式
一:sniper[狙击手] 这种攻击基于原始的请求内容,需要一个字典,每次用字典里的一个值去代替一个待攻击的原始值. 攻击次数=参数个数X字典内元素个数 例如:原始请求中 name=aa , pass ...