網(wǎng)頁(yè)上中下三分布局即上下固定中間自適應(yīng)
發(fā)布時(shí)間:2014-04-30 10:55:59 作者:佚名
我要評(píng)論

網(wǎng)頁(yè)上中下三分布局打破了傳統(tǒng)的布局方式,實(shí)現(xiàn)所謂的上下固定,中間自適應(yīng),大家可以參考學(xué)習(xí)下
復(fù)制代碼
代碼如下:<!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>
<!-- 禁止瀏覽器從本地緩存中調(diào)閱頁(yè)面。-->
<meta http-equiv="pragram" content="no-cache">
<!--網(wǎng)頁(yè)不保存在緩存中,每次訪問都刷新頁(yè)面。-->
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<!--同上面意思差不多,必須重新加載頁(yè)面-->
<!--網(wǎng)頁(yè)在緩存中的過期時(shí)間為0,一旦網(wǎng)頁(yè)過期,必須從服務(wù)器上重新訂閱-->
<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>測(cè)試文本</p>
</div>
</div>
</div>
<div id="footer">footer</div>
</div>
</body>
</html>
相關(guān)文章
Opera瀏覽器怎么固定網(wǎng)頁(yè)的縮放比例?
Opera瀏覽器怎么固定網(wǎng)頁(yè)的縮放比例?使用Opera瀏覽器瀏覽網(wǎng)頁(yè)的時(shí)候,無意中就放大縮小網(wǎng)頁(yè)了,想要固定網(wǎng)頁(yè)的縮放比例,該怎么設(shè)置呢?下面我們就來看看詳細(xì)的教程,需要2017-02-08Win7系統(tǒng)固定IE瀏覽器所有網(wǎng)頁(yè)字體大小的技巧
不同的網(wǎng)頁(yè)就有不同的排版方式,字體的大小也會(huì)不一樣,切換網(wǎng)頁(yè)的時(shí)候,我們的眼睛就很難適應(yīng),下面教大家個(gè)技巧可以固定IE瀏覽器所有網(wǎng)頁(yè)字體大小2015-05-26固定在網(wǎng)頁(yè)右側(cè)的浮動(dòng)層實(shí)現(xiàn)代碼
說到浮動(dòng)層,想必大家都有見到過吧,很熟悉,但是你知道它是怎么實(shí)現(xiàn)的呢?下面有個(gè)不錯(cuò)的示例為大家介紹下網(wǎng)頁(yè)右側(cè)的固定浮動(dòng)層具體實(shí)現(xiàn),感興趣的朋友可以參考下2014-04-23對(duì)網(wǎng)頁(yè)中層的固定實(shí)現(xiàn)代碼
前幾天在對(duì)網(wǎng)頁(yè)頁(yè)面進(jìn)行布局的時(shí)候,遇到一個(gè)需要將網(wǎng)頁(yè)的最下面一個(gè)層固定起來,不隨網(wǎng)頁(yè)的滾動(dòng)條滾動(dòng),添加減少瀏覽器的菜單也不會(huì)變動(dòng)的需求2011-11-06css實(shí)現(xiàn)網(wǎng)頁(yè)欄目左側(cè)固定當(dāng)滾動(dòng)到底部時(shí)自動(dòng)調(diào)整位置
這篇文章主要介紹了css實(shí)現(xiàn)網(wǎng)頁(yè)欄目左側(cè)固定當(dāng)滾動(dòng)到底部時(shí)自動(dòng)調(diào)整位置 ,需要的朋友可以參考下2019-05-29