Learn Mobile page making 3

Source: Internet
Author: User

Mobile Page Production 3

Using the box-sizing mentioned in the previous section to solve a problem of flow pattern layout

A streaming layout of code around the width+border>100% so the box will fall down

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Document</title>    <style>#box{width:100%;Height:300px;background:#fec;    }#left{width:50%;Height:200px;float: Left;Border:1px solid #f00;background:Orange;    }#right{width:50%;Height:200px;float: Left;Border:1px solid #f00;background:Blue;    }    </style></Head><Body>    <DivID= "box">        <DivID= "Left"></Div>        <DivID= "Right"></Div>    </Div></Body></HTML>

After using box-sizing

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Document</title>6     <style>7 #box{8 width:100%;9 Height:300px;Ten background:#fec; One     } A #left{ - width:50%; - Height:200px; the float: Left; - Border:1px solid #f00; - background:Orange; - -webkit-box-sizing:Border-box; + -moz-box-sizing:Border-box; - box-sizing:Border-box; +     } A #right{ at width:50%; - Height:200px; - float: Left; - Border:1px solid #f00; - background:Blue; - -webkit-box-sizing:Border-box; in -moz-box-sizing:Border-box; - box-sizing:Border-box; to  +     } -     </style> the </Head> * <Body> $     <DivID= "box">Panax Notoginseng         <DivID= "Left"></Div> -         <DivID= "Right"></Div> the     </Div> + </Body> A </HTML>

The display was found aligned.

Learn Mobile page making 3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.