Home >Web Front-end >HTML Tutorial >div css adaptive height of the left and right columns, and the parent div also adapts to the height of the child (compatible with major browsers)_html/css_WEB-ITnose
<style type="text/css" media="screen"><!--#main {width:500px;_height:300px;min-height:300px; background:#aaffaa; border:1px solid #600; float:left;overflow:hidden;_overflow:visible;}#sidebar {width:200px;background-color:#ff0000; float:left; border:1px solid #060; }#content {width:200px; background:#0000ff; border:1px solid #006; float:left;}.row{margin-bottom:-10000px;padding-bottom:10000px;}--></style></head><body><div id="main"> <div id="sidebar" class="row"> <p>Layer - left</p> </div> <div id="content" class="row"> Layer - right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> </div></div></body>