Question: There are three blocks on the page. The width and height of the left and right blocks are fixed, and the width of the middle block is full between the left and right blocks. Then the width of the middle block can change with the browser.
Answer 1:
< Div Class = "Left" > Left </ Div >
< Div Class = "Right" > Right </ Div >
< Div Class = "Content" > Medium </ Div >
. Left { Float : Left ; Width : 300px ; Height : 500px ; Background : # F00 ; }
. Right { Float : Right ; Width : 200px ; Height : 500px ; Background : # 00f ; }
. Content { Margin : 0 200px 0 300px ; Height : 500px ; Background : # Ccc ; }
Answer 2:
< Body >
< Div Class = "Left FL" > Left </ Div >
< Div Class = "Body" > Medium </ Div >
< Div Class = "Right FR" > Right </ Div >
</ Body >
. Left,. Right { Width : 100px ; Height : 200px ; Position : Absolute ; Background : Red ; }
. Fl { Left : 0px ; }
. Fr { Right : 0px ; }
. Body { Position : Absolute ; Left : 100px ; Right : 100px ; Background : # Ccc ; }