博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
将div一直保持到页面底部
阅读量:6853 次
发布时间:2019-06-26

本文共 579 字,大约阅读时间需要 1 分钟。

将div保持到页面底部说的是,页面内容满屏和不满屏都在底部,采用js是最常用的方法,但如果能用纯css解决最好了,有网上找了半天,还是有强人的,方法如下:

HTML结构:

CSS样式:

html,body {   margin:0;   padding:0;   height:100%;   _height:100%; /* IE6 hack */} #container {   min-height:100%;   position:relative; } #header {   background:#ff0;   padding:10px; } #body {   padding:10px;   padding-bottom:60px; /* Height of the footer */}#footer {   position:absolute; bottom:0;    width:100%;     height:60px; /* Height of the footer */    background:#6cf; }

转载于:https://www.cnblogs.com/asyuras/archive/2012/06/29/2569554.html

你可能感兴趣的文章
多线程间通信之AutoResetEvent和ManualResetEvent的原理分析和开发示例
查看>>
C#中 @ 的3种用途
查看>>
模板方法模式(Template Pattern)
查看>>
Instr() 函数
查看>>
hdu-acm steps Max sum
查看>>
Radar Installation
查看>>
组队项目四则运算成果
查看>>
使用UIPickerView显示数据
查看>>
java代码继承基础
查看>>
java继承实例基础
查看>>
数据库增删改查梳理
查看>>
linux下检测每个进程占用swap大小
查看>>
[转] 编译输出文件的区别
查看>>
Java MyBatis 插入数据库返回主键--insertSelective这样就不用每次到数据库里面查询了...
查看>>
springboot集成redis操作
查看>>
x64 QWORD Xor shellcode encoder
查看>>
大数据之mapreduce小实战
查看>>
Elasticsearch(二)
查看>>
一步一步学linq to sql(九)其他补充
查看>>
windows service and process 的关系
查看>>