<!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" lang="en" xml:lang="en"> <head> <FCK:meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Dynamic Drive: CSS Fixed Layout #3.1- (Fixed-Fixed-Fixed)</title> <style type="text/css"> body{ margin:0; padding:0; line-height: 1.5em; } b{font-size: 110%;} em{color: red;} #maincontainer{ width: 840px; /*Width of main container*/ margin: 0 auto; /*Center container on page*/ } #topsection{ background: #EAEAEA; height: 90px; /*Height of top section*/ } #topsection h1{ margin: 0; padding-top: 15px; } #contentwrapper{ float: left; width: 100%; } #contentcolumn{ margin: 0 190px 0 180px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/ } #leftcolumn{ float: left; width: 180px; /*Width of left column in pixel*/ margin-left: -840px; /*Set margin to that of -(MainContainerWidth)*/ background: #C8FC98; } #rightcolumn{ float: left; width: 190px; /*Width of right column*/ margin-left: -190px; /*Set left margin to -(RightColumnWidth)*/ background: #FDE95E; } #footer{ clear: left; width: 100%; background: black; color: #FFF; text-align: center; padding: 4px 0; } #footer a{ color: #FFFF80; } .innertube{ margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/ margin-top: 0; } </style> </head> <body> <div id="maincontainer"> <div id="topsection"><div class="innertube"><h1>CSS Fixed Layout #3.1- (Fixed-Fixed-Fixed)</h1></div></div> <div id="contentwrapper"> <div id="contentcolumn"> <div class="innertube"><b>Content Column: <em>Fixed</em></b> </div> </div> </div> <div id="leftcolumn"> <div class="innertube"><b>Left Column: <em>180px</em></b> </div> </div> <div id="rightcolumn"> <div class="innertube"><b>Right Column: <em>190px</em></b> </div> </div> <div id="footer"><a href="http://www.dynamicdrive.com/style/" _fcksavedurl="http://www.dynamicdrive.com/style/">Dynamic Drive CSS Library</a></div> </div> </body> </html>
转自:Dynamic Drive
Copy Rights Reserved: 所有素材均来自互联网。仅提供为学习Div+CSS布局及分享创作经验,请勿作为它用,如出现版权纠纷,均与本站无关。
CSS Fixed Layout #3.2
Posted on: 08-07-17
CSS Fixed Layout #3.1