div+css全屏
2010-08-09 14:23
204 查看
<!-- Put IE into quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
<title>自适应满屏高度的布局-冰极峰</title>
<style type="text/css">
html {height:100%;max-height:100%;padding:0;margin:0;border:0;background:#fff;font-size:76%;font-family:georgia, palatino linotype, times new roman, serif,"宋体";
/* hide overflow:hidden from IE5/Mac */
/* /*/
overflow: hidden;
/* */
}
html {
scrollbar-face-color:orange;
scrollbar-highlight-color:#fff;
scrollbar-shadow-color:#c00;
scrollbar-3dlight-color:#c00;
scrollbar-arrow-color:#000;
scrollbar-track-color:#c0c0c0;
scrollbar-darkshadow-color:#fff;
}
body{height:100%;max-height:100%;overflow:hidden;padding:0;margin:0; border:0;}
#content{overflow:auto; position:absolute; z-index:3; top:100px; width:96%;bottom:80px; left:2%; background:#666;}
*html #content {top:0; left:2%; height:100%; max-height:100%; width:96%; overflow:auto;position:absolute; z-index:3; border-top:100px solid #fff; border-bottom:80px solid #fff;}
#head{position:absolute;margin:0;top:0;left:1px;display:block;width:100%;height:90px;background:orange;background-position:0 0; background-repeat:no-repeat;font-size:4em;z-index:5;overflow:hidden;color:#fff;border-bottom:1px #c0c0c0 solid;text-align:center;}
#foot{position:absolute; margin:0;bottom:0;left:2%;display:block;width:96%;height:70px;font-size:1em;z-index:5;overflow:hidden;color:#fff;text-align:center;}
#content p,h2{padding:10px;font-size:12px;color:#fff;}
#content p.bold {font-size:1.2em; font-weight:bold;color:red;}
#logo{height:75px;line-height:75px;text-align:center;display:block;}
.footleft{width:20%;height:70px;line-height:70px;float:left;border:1px #c0c0c0 solid;background:blue;}
.footmid{width:58%;height:70px;line-height:70px;margin-left:1%;float:left;border:1px #c0c0c0 solid;background:blue;}
.footright{width:20%;height:70px;line-height:70px;float:right;border:1px #c0c0c0 solid;background:blue;}
a:link,a:visited{color:#fff;}
</style>
</head>
<body>
<div id="head">
<span id="logo">100%高度全屏自适应布局</span>
</div>
<div id="foot">
<div class="footleft"><a href="http://www.cnblogs.com/binyong">冰极峰</a></div>
<div class="footmid"><a href="http://www.cnblogs.com/binyong">冰极峰</a></div>
<div class="footright"><a href="http://www.cnblogs.com/binyong">冰极峰</a></div>
</div>
<div id="content">
<h2>此布局惟一的遗憾是在IE6以下浏览器中显示为怪异模式,因为HTML代码的头一句加了一个注释,如果删除后在IE中滚动条高度显示不全.</h2>
<p class="bold">此布局在以下浏览器中测试通过: IE5.5,IE6,IE7,TT,Opera 9.63,Firefox3.0,谷歌,IE8未作测试。</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</body>
</html>
来自:http://www.alixixi.com/web/a/2009051255912.shtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
<title>自适应满屏高度的布局-冰极峰</title>
<style type="text/css">
html {height:100%;max-height:100%;padding:0;margin:0;border:0;background:#fff;font-size:76%;font-family:georgia, palatino linotype, times new roman, serif,"宋体";
/* hide overflow:hidden from IE5/Mac */
/* /*/
overflow: hidden;
/* */
}
html {
scrollbar-face-color:orange;
scrollbar-highlight-color:#fff;
scrollbar-shadow-color:#c00;
scrollbar-3dlight-color:#c00;
scrollbar-arrow-color:#000;
scrollbar-track-color:#c0c0c0;
scrollbar-darkshadow-color:#fff;
}
body{height:100%;max-height:100%;overflow:hidden;padding:0;margin:0; border:0;}
#content{overflow:auto; position:absolute; z-index:3; top:100px; width:96%;bottom:80px; left:2%; background:#666;}
*html #content {top:0; left:2%; height:100%; max-height:100%; width:96%; overflow:auto;position:absolute; z-index:3; border-top:100px solid #fff; border-bottom:80px solid #fff;}
#head{position:absolute;margin:0;top:0;left:1px;display:block;width:100%;height:90px;background:orange;background-position:0 0; background-repeat:no-repeat;font-size:4em;z-index:5;overflow:hidden;color:#fff;border-bottom:1px #c0c0c0 solid;text-align:center;}
#foot{position:absolute; margin:0;bottom:0;left:2%;display:block;width:96%;height:70px;font-size:1em;z-index:5;overflow:hidden;color:#fff;text-align:center;}
#content p,h2{padding:10px;font-size:12px;color:#fff;}
#content p.bold {font-size:1.2em; font-weight:bold;color:red;}
#logo{height:75px;line-height:75px;text-align:center;display:block;}
.footleft{width:20%;height:70px;line-height:70px;float:left;border:1px #c0c0c0 solid;background:blue;}
.footmid{width:58%;height:70px;line-height:70px;margin-left:1%;float:left;border:1px #c0c0c0 solid;background:blue;}
.footright{width:20%;height:70px;line-height:70px;float:right;border:1px #c0c0c0 solid;background:blue;}
a:link,a:visited{color:#fff;}
</style>
</head>
<body>
<div id="head">
<span id="logo">100%高度全屏自适应布局</span>
</div>
<div id="foot">
<div class="footleft"><a href="http://www.cnblogs.com/binyong">冰极峰</a></div>
<div class="footmid"><a href="http://www.cnblogs.com/binyong">冰极峰</a></div>
<div class="footright"><a href="http://www.cnblogs.com/binyong">冰极峰</a></div>
</div>
<div id="content">
<h2>此布局惟一的遗憾是在IE6以下浏览器中显示为怪异模式,因为HTML代码的头一句加了一个注释,如果删除后在IE中滚动条高度显示不全.</h2>
<p class="bold">此布局在以下浏览器中测试通过: IE5.5,IE6,IE7,TT,Opera 9.63,Firefox3.0,谷歌,IE8未作测试。</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</body>
</html>
来自:http://www.alixixi.com/web/a/2009051255912.shtml
相关文章推荐
- CSS DIV 上下左右完全全屏居中
- 背景全屏,左右两边颜色不一样,DIV+CSS 布局
- 纯CSS 实现DIV 高度 height 100% 全屏布局
- CSS实现div的全屏自适应显示(两种方案)
- DIV+CSS 全屏垂直居中的一个办法
- 【css】CSS实现div的全屏自适应显示
- CSS+DIV两栏式全屏布局
- 全屏的三栏div+css布局示例
- div+css全屏自适应+水平垂直居中 【同事武功传授】
- Css三角形 div全屏 半透明
- Div+CSS布局入门教程--页面制作-用好border和clear
- DIV+CSS布局-固定页面开度布局
- div+css+jq省市联动可扩展
- Div+CSS命名规范
- css + div 列表布局
- div+css布局之定位
- css+div网页设计(一)--基础知识
- IE8下DIV+CSS 背景图片 错位 问题
- 10个 DIV+CSS 需要注意的问题
- div+css 浏览器兼容