手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >网页上中下三分布局即上下固定中间自适应
网页上中下三分布局即上下固定中间自适应
摘要:*{margin:0;padding:0;}html,body,#box{height:100%;font:small/1.5"宋体",se...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<>

<meta http-equiv="pragram" content="no-cache">

<>

<meta http-equiv="cache-control" content="no-cache, must-revalidate">

<>

<>

<meta http-equiv="expires" content="0">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title></title>

<style type="text/css">

* {

margin:0;

padding:0;

}

html,

body,

#box {

height:100%;

font:small/1.5 "宋体", serif;

}

body {

text-align:center;

}

#box {

text-align:left;

background:#666;

display:table;

width:80%;

margin:0 auto;

position:relative;

}

#box > div {

display:table-row;

}

#header,

#footer {

background:#fcc;

height:50px;

vertical-align:bottom;

}

#main {

background:#ccf;

}

#main #wrap {

display:table-cell;

background:#ffc;

vertical-align:middle;

}

#text {

text-align:center;

}

</style>

<>

</head>

<body>

<div id="box">

<div id="header">header</div>

<div id="main">

<div id="wrap">

<div id="text">

<p>测试文本</p>

</div>

</div>

</div>

<div id="footer">footer</div>

</div>

</body>

</html>

【网页上中下三分布局即上下固定中间自适应】相关文章:

DIV下图片自适应解决方法

CSS网页布局中默认字体样式

CSS布局——左定宽度右自适应宽度并且等高布局

CSS网页布局时常犯的几种小错误

让网页中居中层css一则

CSS如何给一个绝对定位的元素设定自适应宽度

CSS网页布局的技巧

修复网页在IE8下的显示兼容问题

DIV+CSS网页设计常用布局代码

WEB标准布局的Div + CSS 高度自适应解决方法

精品推荐
分类导航