Summarize:
1. Use style height:100% set div height to full screen when all the parent elements must be set, but the parent element is so many, not controllable, so this method is not feasible;
2. The padding of the parent frame is float,padding valid for 100px,div, but the DIV is position, and the left:0,padding fails;
3. The elastic box model requires a position attribute and two relative properties, such as top and bottom,left and right.
4. To make three modules from the adaptation, calculate the left and right values for the middle Div after position, which is related to the div widths on both sides of the
The code for the test is as follows:
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8" /> <title></title> <styletype= "Text/css"> *{padding:0;margin:0; } /*html,body{height:100%; }*/. Elasticitybox{Border:1px #000 Solid;padding:100px; }. Elasticitybox. box01{position:Absolute;Border:1px Red Solid;Top:0;Bottom:0; Left:200px; Right:200px; } /*. Elasticitybox. box01{border:1px Red Solid; Float:left; }*/. Elasticitybox. box02{Border:1px yellowgreen Solid;width:100px;position:Absolute; Left:0;Top:0;Bottom:0; }. Elasticitybox. box03{Border:1px yellowgreen Solid;width:100px;position:Absolute; Right:0;Top:0;Bottom:0; } </style> </Head> <Body> <Divclass= "Elasticitybox"> <Divclass= "box01">123</Div> <Divclass= "box02">3456</Div> <Divclass= "box03">789</Div> </Div> </Body></HTML>
CSS Position Elastic box test