首页前端开发HTML网页上中下三分布局即上下固定中间自适应

网页上中下三分布局即上下固定中间自适应

时间2024-01-24 03:16:23发布访客分类HTML浏览555
导读:收集整理的这篇文章主要介绍了网页上中下三分布局即上下固定中间自适应,觉得挺不错的,现在分享给大家,也给大家做个参考。 复制代码代码如下: <!DOCTYPE htML PubLIC "-//W3C//DTD XHTML 1....
收集整理的这篇文章主要介绍了网页上中下三分布局即上下固定中间自适应,觉得挺不错的,现在分享给大家,也给大家做个参考。
复制代码代码如下:
!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">
!--同上面意思差不多,必须重新加载页面-->
!--网页在缓存中的过期时间为0,一旦网页过期,必须从服务器上重新订阅-->
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>
!--[if IE]>
style type="text/css">
#header,
#footer {
width:100%;
z-index:3;
position:absolute;
}
#footer {
bottom:0;
}
#main {
height:100%;
z-index:1;
position:relative;
}
#main #wrap {
position:absolute;
top:50%;
width:100%;
text-align:left;
}
#main #text {
position:relative;
width:100%;
top:-50%;
background:#ccc;
}
/style>
![endif]-->
/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>

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!

上一篇: 使用z-index:-1 让一个层在所有层...下一篇:div+css实现两列table效果示例猜你在找的html5相关文章 关于移动端h5开发相关内容总结2022-05-17html5教程-学表单的第二天2018-12-10html5教程-HTML5浏览器支持2018-12-10html5教程-HTML5智能表单2018-12-10html5教程-微信H5使用resLoader实现加载页效果2018-12-10html5教程-day01-初级-JS0-热身运动JS入门教程2018-12-10html5教程-html5shiv.js和respond.min.js2018-12-10html5教程-不同浏览器对于html5 audio标签和音频格式的兼容性2018-12-10html5教程-使用Html5实现手风琴案例2018-12-10html5教程-html5笔记2018-12-10 其他相关热搜词更多phpjavapython程序员load

若转载请注明出处: 网页上中下三分布局即上下固定中间自适应
本文地址: https://pptw.com/jishu/584955.html
div与span的区别和使用示例 使用z-index:-1 让一个层在所有层的下面当背景

游客 回复需填写必要信息