<! DOCTYPE HTML Public "-//w3c//dtd XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD "> <meta http-equiv= "content-type" content= "text/html; charset=gb2312 "/> <title> single-row fixed-width single-row Adaptive Structure </title> <style> /* set the internal and external patches of all elements in the page to 0 for easy page layout */ *{ margin:0; padding:0; } /* set the header information and the height of the bottom information to 30px, and add a light gray background */ #header, #footer { height:30px; Background-color: #e8e8e8; } /* set the page content area Up-down patch to 10px*/ #container { margin:10px 0; } /* set the main content area width to 70%, background color and text colors, and left display */ . mainbox{ float:left;/* floating the main content area to the left */ width:70%;/* Change the width of the mainbox to 70%*/ Color: #ff0000; Background-color: #333333; } /* Set the sidebar width to 200px, background and text color, and right display */ . sidebox{ float:right;/* float the sidebar to the right */ width:200px;/* Change the width of the sidebox to 200px*/ margin-left:-200px;/* add a negative margin so that the sidebox to the left floating indentation, that is, when the browser window is small and does not change the size of sidebox, then Sidebox will be inserted into the next mainbox, and if not set, The window changes in hours and breaks down the layout */ Color: #ffffff;/* Set Text color */ Background-color: #999999; /* Set Background color */ } /* clear the left and right floating of content area, this paragraph focus on understanding (after what Meaning) */ #container: after{ display:block; visibility:hidden; font-size:0; line-height:0; clear:both; Content: ""; } /* Add level information to the floating purge of the parent tag element */ #footer { clear:both; } </style> <body> <div id= "header" > header information </div> <div id= "container" > <div class= "mainbox" > <p> Main content Area </p> <p> is no longer just a line of text </p> <p> want to put a lot of things into this area </p> <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. <p> repeat, repeat, ......</p>. </div> <div class= "sidebox" > Sidebar </div> </div> <div id= "footer" > Bottom Info </div> </body> |