网页上中下三分布局即上下固定中间自适应
网页上中下三分布局即上下固定中间自适应
发布时间:2016-12-27 来源:查字典编辑
摘要:*{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教程学习
热门 Div+Css教程学习
网页设计子分类