div+css最窄770px最宽1024px的经典布局

div+css最窄770px最宽1024px的经典布局

<br/><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br/><html xmlns="http://www.w3.org/1999/xhtml"><br/><head><br/><title>最窄770px最宽1024px的经典布局</title><br/><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br/><br/><style type="text/css"><br/><br/>* { margin:0; padding:0;}<br/>body { padding:10px 0 0 0; color:#000; background:#fff; text-align:center;}<br/>#wrapper{ width:auto; border:1px solid #000; min-width:770px; max-width:1024px; text-align:left; margin-left:auto; margin-right:auto; position:relative;}<br/><br/>#outer{ margin-left:130px; margin-right:130px; background:silver; border-left:1px solid #000; border-right:1px solid #000; color: #000;}<br/>#header{ position:absolute; top:0; left:0; width:100%; height:70px; line-height:70px; border-bottom:1px solid #000; overflow:hidden; background:#0ff; text-align:center; font-size:xx-large}<br/>#left {<br/>  position:relative;/*ie needs this to show float */<br/>  width:130px;float:left;left:-1px;<br/>  margin-left:-129px;/*must be 1px less than width otherwise won't push footer down */<br/>}<br/>* html #left { margin-right:-3px;}/* 3px jog*/<br/>* html #outer{/* 3px jog*/<br/>  margin-left:127px; margin-right:127px;}<br/>p { margin-bottom:1em; padding:0 5px}<br/><br/>#right {<br/>  position:relative;/*ie needs this to show float */<br/>  width:130px; float:right; left:1px;<br/>  margin-right:-129px;/*must be 1px less than width otherwise won't push footer down */<br/>}<br/><br/>* html #right { margin-right:-130px; margin-left:-3px}/* stop float drop in ie + 3px jog */<br/><br/>#footer { width:100%; clear:both; line-height:50px; border-top:1px solid #000; background:#ffc; color:#000; text-align:center; position:relative;}<br/>#clearheader{ height:72px;}/*needed to make room for header*/<br/>#centrecontent { float:right; width:100%; position:relative;}<br/><br/>html>body #centrecontent { margin:0 -0.5%}/*moz needs this*/<br/>.outerwrap { float:left; width:99%;}<br/>.clearer{ height:1px; overflow:hidden; margin-top:-1px; clear:both;}<br/><br/>/* mac hide\*/<br/>* html #outer, * html #wrapper,* html #centrecontent { height:1%}<br/>/* end hide */<br/><br/></style><br/><!--[if gte IE 5]><br/><style type="text/css"><br/>body {width:expression( documentElement.clientWidth < 770 ? (documentElement.clientWidth == 0 ? (body.clientWidth < 770 ? "770" : "auto") : "770px") : "auto" );}<br/>#wrapper {width:expression( documentElement.clientWidth > 1024 ? (documentElement.clientWidth == 0 ? (body.clientWidth >1024 ? "1024" : "auto") : "1024px") : "auto" );}<br/></style><br/><![endif]--><br/></head><br/><br/><body><br/><div id="wrapper"><br/><div id="outer"> <br/><br/>  <div id="clearheader"></div><br/><br/>  <div class="outerwrap"> <br/>  <br/>    <div id="centrecontent"> <br/>      <h1>Min width of 770px and max width of 1024px</h1><br/>      <p>centre content goes here centre content goes here : centre content <br/>        goes here centre content goes here : centre content goes here centre <br/>        content goes here : centre content goes here centre content goes here <br/>        : centre content goes here centre content goes here : centre content <br/>        goes here centre content goes here : centre content goes here centre <br/>        content goes here : centre content goes here centre content goes here <br/>        : centre content goes here centre content goes here : centre content <br/>        goes here centre content goes here : centre content goes here centre <br/>        content goes here : centre content goes here centre content goes here <br/>        : centre content goes here centre content goes here : centre content <br/>        goes here centre content goes here : centre content goes here centre <br/>        content goes here : centre content goes here centre content goes here <br/>        : centre content goes here centre content goes here : centre content <br/>        goes here centre content goes here : centre content goes here centre <br/>        content goes here : centre content goes here content goes here : </p><br/>    </div><br/>    <br/>    <div id="left"> <br/>      <p>Left content goes here : Left content goes here : Left content goes <br/>      here : Left content goes here : Left content goes here : Left content <br/>      goes goes here : Left content goes here : </p><br/>    </div><br/>    <br/>    <div class="clearer"></div><br/>    <br/>  </div><br/>  <br/>  <!--end outer wrap --><br/>  <div id="right"> <br/>    <p>Start Right content goes here : Right content goes here : Right content <br/>    goes here : Right content goes here : Right content goes here : Right <br/>    content goes here : Right content goes here : Right content goes here <br/>    : Right content goes here : </p><br/>  </div><br/>  <br/>  <div class="clearer"></div><br/><br/></div><br/><br/><div id="footer">Footer - | - Footer </div><br/><div id="header">Header </div><br/><br/></div><br/></body><br/></html><br/><br/>

0 条留言

我要留言
(必填)
(必填,绝不公开)