Two-column layout (one column fixed width, one column adaptive)

Source: Internet
Author: User

Implement two-column layouts with Table+table-cell (one column is fixed width, one column is adaptive, and table is automatically ascending by two columns)

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Document</title>6     <styletype= "Text/css">7 . Parent{8 Background-color:Grey;9 width:500px;Ten Height:300px; One padding:10px; A box-sizing:Border-box; -  - Display:Table; the Table-layout:fixed;//speed up the rendering of table to realize layout first -     } - . Left{ - width:100px; + Display:Table-cell; - Background-color:Skyblue; + Border-right:10px Solid Transparent; A Background-clip:padding-box;//Setting the display position of the background at     } - . Right{ - Display:Table-cell; - Background-color:Greenyellow; -     } -     </style> in </Head> - <Body> to     <Divclass= "Parent"> +         <Divclass= "Left"></Div> -         <Divclass= "Right"></Div> the     </Div> * </Body> $ </HTML>

Two-column layout (one column fixed width, one column adaptive)

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.