html高度随分辨度改变而改变
2015-12-03 15:24
549 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>无标题文档</title>
<style type="text/css">
html,body{height:100%; width:100%; overflow:hidden; margin:0; padding:0;}
.a1{width:100%; height:80px; color:#fff; background-color:#369; text-align:center;}
.main{width:100%; height:80%; overflow:hidden; margin:0; padding:0;}
.a2{width:100%; height:100%; color:#fff; background-color:#666; text-align:center;"}
.a3{width:100%; height:80px; color:#fff; background-color:black; text-align:center;overflow:hidden;}
</style>
</head>
<body>
<div class="a1">div1</div>
<div class="main">
<div class="a2">div2</div>
</div>
<div class="a3">div3</div>
</body>
</html>
<html>
<head>
<title>无标题文档</title>
<style type="text/css">
html,body{height:100%; width:100%; overflow:hidden; margin:0; padding:0;}
.a1{width:100%; height:80px; color:#fff; background-color:#369; text-align:center;}
.main{width:100%; height:80%; overflow:hidden; margin:0; padding:0;}
.a2{width:100%; height:100%; color:#fff; background-color:#666; text-align:center;"}
.a3{width:100%; height:80px; color:#fff; background-color:black; text-align:center;overflow:hidden;}
</style>
</head>
<body>
<div class="a1">div1</div>
<div class="main">
<div class="a2">div2</div>
</div>
<div class="a3">div3</div>
</body>
</html>
相关文章推荐
- Web布局连载——两栏固定布局(五)
- [div+css]晒晒最新制作专题推广页模板
- 在Windows 8.1的IE 11中屏蔽双击放大功能
- 设计更快的网页(三):字体和 CSS 调整
- 纯CSS制作的新闻网站中的文章列表
- 10条影响CSS渲染速度的写法与使用建议第1/3页
- 通过Mootools 1.2来操纵HTML DOM元素
- BS项目中的CSS架构_仅加载自己需要的CSS
- 很不错的 CSS Hack 又学了一招
- 发一个css比较清爽的写法
- CSS expression控制图片自动缩放效果代码[兼容 IE,Firefox]
- css布局网页水平居中常用方法
- CSS经典技巧十则第1/2页
- css 兼容性问题this.style.cursor=''hand''
- IE6不能正常解析CSS文件问题的解决方法及原因分析
- 欲练CSS ,必先解决IE的一些细节分析
- CSS文字截取功能实现代码
- 支持IE6 IE7 Firefox 的纯CSS的下拉菜单
- WEB标准网页布局中尽量不要使用的HTML标签