Div+CSS 製作三欄式頁面配置(左右高度隨中間內容自動調整)

來源:互聯網
上載者:User

以下為CSS檔案內容,檔案名稱為1.css

body { font: 100% 宋體, Arial, Helvetica, sans-serif; background: #666666; margin: 0px; padding: 0px; text-align: center; } #container { width: 780px; background: #FFFFFF; margin: 0px auto; padding: 0px; border: 0px; } #header { background: #DDDDDD; padding: 0px; margin:0px; width:100%; } #contentContainer { width: 100%; background: #FFFF00; padding:0px; margin:0px; overflow:hidden; } #contentLeft { background: #ff0000; float:left; padding: 0px; margin:0px; width:200px; padding-bottom:100000px; margin-bottom:-100000px; } #contentRight { background: #0000ff; float:left; padding: 0px; margin:0px; width:200px; padding-bottom:100000px; margin-bottom:-100000px; } #content { background: #00ff00; padding: 0px; margin:0px auto; width:380px; float:left; } #footer { clear:left; background: #DDDDDD; padding: 0px; margin:0px; width:100%; }

 

 

以下是HTML頁面

 

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test</title> <link type="text/css" rel="stylesheet" href="1.css" mce_href="1.css" /> <mce:script type="text/javascript"></mce:script> </head> <body> <div id="container"> <div id="header"> 標題 </div> <div id="contentContainer"> <div id="contentLeft"> left </div> <div id="content"> content <br /> asf <br /> sdfsa <br /> safs </div> <div id="contentRight"> right </div> </div> <div id="footer"> 腳註 </div> </div> </body> </html>

相關文章

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.