Use Padding-bottom for highly adaptive
1 <!DOCTYPE HTML>2 <HTMLLang= "zh">3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Height Auto</title>6 <!--Join Meta Viewport -7 <Metaname= "Viewport"content= "Width=device-width, User-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">8 <style>9 *{Ten padding:0; One margin:0; A } - #box{ - Height:45px; the width:100%; - background:#f30; - Display:-webkit-box; - position:relative; + } - #logo{ + width:100px; A background:#f00; at Height:45px; - Display:Block; - - - - } in #nav{ - -webkit-box-flex:1; to -moz-box-flex:1; + -ms-box-flex:1; - Box-flex:1; the } * #btn{ $ width:50px;Panax Notoginseng background:Blue; - } the . List{ + width:100%; A the } + . List ul{ - Display:-webkit-box; $ List-style-type:None; $ } - . List Li{ - -webkit-box-flex:1; the -moz-box-flex:1; - -ms-box-flex:1;Wuyi Box-flex:1; the background:#eee; - width:30%; Wu Margin-right:3%; - /*set Height to 0 padding-bottom:30% reference is also the height of the Father*/ About Height:0; $ /*picture height of the width/height* area*/ - Padding-top:30%; - } - </style> A </Head> + <Body> the <!--H1 inside write words with text-indent use SEO - - <DivID= "box"> $ <DixID= "logo">Logo</Dix> the <DivID= "NAV"></Div> the <DivID= "BTN"></Div> the </Div> the <Divclass= "List"> - <ul> in <Li><imgsrc=""alt=""></Li> the <Li></Li> the <Li></Li> About </ul> the </Div> the </Body> the </HTML>
Learn Mobile page making 5