一個自適應的寬度的兩列網頁布局,自適應寬度兩列

來源:互聯網
上載者:User

一個自適應的寬度的兩列網頁布局,自適應寬度兩列
<!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="Content-Type" content="text/html; charset=utf-8" />
<title>絕對位置:一欄固定,一欄自適應</title>
<style type="text/css">
<!--
* {
margin:0;
padding:0;
}
body {
background:#fff;
font:12px normal Arial #444;
line-height:18px;
text-align:center;
}
#box {
width:100%;
height:500px;
margin:0 auto;
background:#f2f2f2;
}
.header {
width:100%;
height:30px;
background:#39c;
}
.right {
width:240px;
height:400px;
background:#fff;
position:absolute;
right:20px;
top:50px;
}
.left {
margin-right:280px;
margin-top:20px;
background:#fff;
margin-left:40PX;
height:400px;
}
.content {
width:96%;
height:300px;
margin:0 auto;
background:#444;
}
.footer {
width:100%;
height:100px;
background:#f2f2f2;
}
p {
padding:10px 10px;
font-size:16px;
font-weight:bold;
color:#39C;
line-height:22px;
}
 //
-->
</style>
</head>
<body>
<div id="box">
  <div class="header"><span style="color:#fff; font-size:14px;font-weight:bold; line-height:28px;">頭部自適Div</span></div>
  <div class="left">
    <p>左則自適應縮放</p>
    <div class="content">
      <p>內容區塊,相對父元素按百分比適應</p>
    </div>
  </div>
  <div class="right">
    <p>絕對固寬定位的右側欄>
  </div>
  <div class="footer">
    <p>底部自適應</p>
  </div>
</div>
<div><A href="http://www.999jiujiu.com/">http://www.999jiujiu.com/</A></div>
</body>
</html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.