The three-column layout is defined by defining the left and right sides, then defining the middle , and setting the 'margin' property of the ' Middle ' section. For example:
1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTMLxmlns= "http://www.w3.org/1999/xhtml">3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" />5 <style>6 Body{margin:0;}7 #content{width:470px;margin:0 Auto;}8 #side{background:#99FF99;Height:300px;width:120px;float: Left; }9 #side1{background:#99FF99;Height:300px;width:120px;float: Right; }Ten #main{background:#99FFFF;Height:300px;margin:0 120px; } One </style> A </Head> - <Body> - <DivID= "Content"> the <DivID= "side">The contents of the ID "side" are shown here</Div> - <DivID= "Side1">The contents of the ID "Side1" are shown here</Div> - <DivID= "Main">The contents of the ID "main" are shown here</Div> - </Div> + </Body> - </HTML>
The result of the operation is:
Css-3 Column Layout