实现<div>高度最大化的纯css方案
2014-10-19 21:49
211 查看
<html> <head> <style type="text/css"> html, body { height: 100%; margin: 0px; } /* this is the big trick*/ #wrapper:before { content:''; float: left; height: 100%; } #wrapper { height: 100%; background-color: black; color: white; } #header { background-color:#000; } #content { background-color: grey; } /* this is the big trick*/ #content:after { content:''; display: block; clear: both; } </style> </head> <body> <div id="wrapper"> <div id="header"> Title here </div> <div id="content">Some content</div> </div> </body> </html>
转自:
Set div to fill in the rest of the height dynamically?
相关文章推荐
- DIV+CSS+JS实现图片<ul><li></li></ul>无缝滚动代码
- DIV+CSS+JS实现图片<ul><li></li></ul>无缝滚动代码
- <div+css页面布局课堂笔记>7---登录和注册界面的实现
- DIV+CSS布局入门示例(四)页面顶部 列表<li>制作菜单
- CSS实现不定高度DIV绝对居中
- 用DIV+CSS模拟textarea,实现文本框高度自适应用户输入的文本
- CSS - How to align a <div> center?
- 使用<frameset><frame/><frame/></frameset> 布局页面 (div+css布局 和frameset布局,两种并列策略)
- 页面table的每行都有一个<input type='button' />,如何实现点击按钮在按钮下方弹出一个div,点击空白消失
- Div+css布局之<img>和<a>底部对齐
- div+css如何实现最小高度。
- HTML<css+div> 基础学习
- (div+css)上下固定中间自适应高度网页布局的实现(FF,IE)
- 纯div+css实现列等高,左右div适应高度
- Div+css+js实现高度适应浏览器,做出的效果像winform
- (div+css)上下固定中间自适应高度网页布局的实现
- 9、如何控制框架页面或<iframe>内嵌页面在指定页面(区域)打开页面? [除了div+css,框架页面也不能忘记]
- (div+css)上下固定中间自适应高度网页布局的实现(FF,IE)
- 使用css制作三角,兼容IE6,用到的标签&lt;div&gt;&lt;s&gt;&lt;span&gt;
- 使用css制作三角,兼容IE6,用到的标签<div><s><span>