高度自适应

div 自适应高度 自动填充剩余高度

 

方案1:

Html:

1
2
3
4
<div class="outer">
    <div class="A"> 头部DIV </div>
    <div class="B">下部DIV </div>
</div>

CSS:

1
2
3
4
5
html,
body { height100%padding0margin0; }
.outer { height100%padding100px 0 0; box-sizing: border-box ; positionrelative; }
.A { height100pxbackground#BBE8F2positionabsolutetop0 left0 width100%; }
.B { height100%background#D9C666; }

效果:

 

方案2:

HTML:

1
2
3
4
<div class="outer">
    <div class="A">头部DIV</div>
    <div class="B">下部DIV</div>
</div>

CSS:

1
2
3
4
5
html,
body { height100%padding0margin0; }
.outer { height100%padding100px 0 0; box-sizing: border-box ; }
.A { height100pxmargin-100px 0 0background#BBE8F2; }
.B { height100%background#D9C666; }

效果:

来源:http://www.cnblogs.com/Mickey697/p/10830510.html


智能推荐

jxl 操作模板,自适应高度HssfCellStyle 自适应。

2019独角兽企业重金招聘Python工程师标准>>> 一:HSSFCellStyle // 生成一个样式 HSSFCellStyle style = workbook.createCellStyle(); // 设置这些样式 style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中  style.setVertical...

上盒子固定 下面自适应高度

<style> html, body { height: 100%; padding: 0; margin: 0; } .outer { height: 100%; position: relative; } .A { height: 100px; background: #BBE8F2; } .B { background: #D9C666; width: 100%; positio...

小程序swiper(tab)高度自适应

swiper高度问题一直困扰我。今天终于有时间来解决一下。因为他的高度不能固定死,写死其他数据展示不完全,不写或者100%,auto都不行。翻了一堆资料也查了很多,最后总结一下。 1.很多人都说用一种方法。就是高度*数量,也就是所说的获取数据数组长度,根据数据长度来动态改变每页的长度,因为字号啊什么的在各个手机显示不一定都相同,总感觉不是解决问题的最佳方法。 2.使用Swiper+scroll-v...

css解决高度自适应问题

转自:https://www.cnblogs.com/zhujl/archive/2012/03/20/2408976.html css解决高度自适应问题 高度自适应问题,我很抵触用js去解决,因为不好维护,也不够自然,但是纯用CSS,难度不小,比如下面我要说的例子。 需求: 这个矩形的高度和浏览器窗口的高度相同,不能出现纵向滚动条; 绿色部分高度固定,比如50px; 紫色部分填充剩余的高度; h...

CSS 自适应高度 局部滚动

要实现一个局部滚动的效果:一个表格,表头固定,表体根据自适应填充的高度滚动,如下图 实现方法: 利用div嵌套表格。 一个div嵌套表头,一个div包裹table,并且此div设置滚动 主要结构:  ...

猜你喜欢

layui表格行高度自适应

.layui-table-cell { font-size:14px; padding:0 5px; height:auto; overflow:visible; text-overflow:inherit; white-space:normal; word-break: break-all; }...

easyui-layout布局高度自适应

动态加载datagrid数据 $("#dg_center").datagrid({                 url: ''/AJAX/EasyUiListComm.ashx',                 f...

原型对象,原型链

函数都有prototype属性,它指向原型对象。 实例对象有__proto__属性,它指向对象原型 每一个原型对象都有constructor输赢,指向构造函数,每一个原型对象又具有__proto__属性,这个指向Object.prototype.在这里插入图片描述...

Node 调用 dubbo 服务的探索及实践

2.Dubbo简介 2.1 什么是dubbo Dubbo是一款高性能、轻量级的开源Java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现。 2.2 流程图 Provider : 暴露服务的服务提供方。 Consumer : 调用远程服务的服务消费方。 Registry : 服务注册与发现的注册中心。 Monito...

mysql总结

mysql基础入门的总结     关于数据库:     数据库是软件开发人员要掌握的基本工具,软件的运行的过程就是操作数据的过程,数据库中的数据无非就是几个操作:增-删-查-改。         Mysql安装完成后,需要配置变量环境,找到配置路径path,然后把mysql安装目录bin文件导入就可以了。 然后运行cm...

问答精选

Correctly formatting GCM notifications?

I'm currently trying out the google cloud messaging service with its sample application "Guestbook." https://developers.google.com/cloud/samples/mbs/ I'm attempting to send notifications tha...

Are there any performance benefits of using Asynchronous functions over Synchronous in Node Js?

Now I came across an article that distinguishes between an Asynchronous function and Synchronous functions. From my understanding of the different examples and explanations, synchronous functions are ...

Python: Costing calculator output

Good day all I'm busy creating a small costing calculator for the signage department. I'm not getting the calculator to output the amount. Brief Description: You enter the height and width and then wh...

Flask-SQLAlchemy - model has no attribute 'foreign_keys'

I have 3 models created with Flask-SQLalchemy: User, Role, UserRole role.py: user.py: user_role.py: If I try (in the console) to get all users via User.query.all() I get AttributeError: 'NoneType' obj...

Seeding many PRNGs, then having to seed them again, what is a good quality approach?

I have many particles that follow an stochastic process in parallel. For each particle, there is a PRNG associated to it. The simulation must go through many repetitions to get average results. For ea...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答