CSS implementation of the left and right two columns of the width of the adaptive middle column width fixed:
More time may be set left and right two columns width fixed, the middle column width adaptive, but this chapter is the opposite, the following describes how to achieve the middle column width fixed, left and right two column width adaptive, about the left and right two columns fixed, left and right width self-adaptation can see The left and right two column widths fixed the middle column Width Adaptive code example section.
code example:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">*{margin:0;padding:0;}Body{font-family:Verdana, Arial, Helvetica, Sans-serif;Min-width:620px;}#header, #footer{Clear:both;padding:10px;text-align:Center;}#left, #right{float: Left;width:50%;margin:0 0 0-151px;}#innerLeft, #innerRight{margin:0 0 0 151px;Background-color:#efefef;}#middle{float: Left;width:300px;Background-color:#ccc;}. Inner{padding:12px;text-align:Center;font-size:12px;}</style></Head><Body><DivID= "Left"> <DivID= "Innerleft"class= "inner">Left column</Div></Div><DivID= "Middle"> <DivID= "Innermiddle"class= "inner">Middle Column</Div></Div><DivID= "Right"> <DivID= "Innerright"class= "inner">Right column</Div></Div></Body></HTML>
The above code realizes our requirements, can achieve the middle column size fixed, both ends of the column width adaptive effect.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=15086
For more information, refer to: http://www.softwhy.com/divcss/
CSS implementation of the left and right two columns width of the middle column width fixed