The method of adaptive height of left and right columns of DIV+CSS

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>

The method of <TITLE>DIV+CSS two-column adaptive height-htmer</title>

<style type= "Text/css" >

. Main{500px;overflow:hidden;}

. Left{width:100px;background-color: #0CC; margin-bottom:-9999px;padding-bottom:9999px;float:left;}

. Right{width:400px;background-color: #F00; float:left;}

</style>

<body>

<div class= "Main" >

<div class= "Left" > Content 1</div>

<div class= "Right" > Contents 1<br/> Right content 2<br/> Right content 3</div>

</div>

</body>

Description: In fact, to solve the div+css about two columns height adaptive method is to pay attention to two points: first, the outermost plus overflow:hidden, and then add margin-bottom:-9999px;padding-bottom:9999px on the left column; Can. Original article: http://www.blogbus.com/ada-life-logs/231591213.html

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.