5pteron
11-08-2008, 09:44 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
html,body { height: 100%; }
#wrapper {
width: 790px;
margin-top: 20px;
margin-right: auto;
margin-left: auto;
height: 100%;
}
#sidebar {
float: right;
width: 160px;
background-color: #00FF33;
min-height: 100%;
position: relative;
}
* html #sidebar { /* this is needed to fake min-height in IE 6 */
height:100%;
}
#content {
width: 630px;
}
-->
</style>
</head>
<body>
<div id="wrapper">
<div id="sidebar">sidebar</div>
<div id="content">
<p>Content for id "content" Goes Here</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p> </p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p> </p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p> </p>
<p>d</p>
<p> </p>
</div>
</div>
</body>
</html>
I want to make the height of the sidebar extend as the content gets long. Now, the sidebar div will just only make its height the browser-window height. How can I make it extend to where the content ends?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
html,body { height: 100%; }
#wrapper {
width: 790px;
margin-top: 20px;
margin-right: auto;
margin-left: auto;
height: 100%;
}
#sidebar {
float: right;
width: 160px;
background-color: #00FF33;
min-height: 100%;
position: relative;
}
* html #sidebar { /* this is needed to fake min-height in IE 6 */
height:100%;
}
#content {
width: 630px;
}
-->
</style>
</head>
<body>
<div id="wrapper">
<div id="sidebar">sidebar</div>
<div id="content">
<p>Content for id "content" Goes Here</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p> </p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p> </p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p>d</p>
<p> </p>
<p>d</p>
<p> </p>
</div>
</div>
</body>
</html>
I want to make the height of the sidebar extend as the content gets long. Now, the sidebar div will just only make its height the browser-window height. How can I make it extend to where the content ends?