dlg0351
05-05-2006, 12:16 AM
I am trying to make the conversion from tables where things were so much easier, to using only divs and css.
I am having trouble getting the left div (navigation) to expand vertically as the right div (content) expands. Basically I want the yellow background to be the same height as the blue background, But I don't know the length of the content background because that is going to change on every page.
Using tables the cell expanded automatically as the content grew.
Can anyone help me with this? It seems like an easy and common thing to do, but I am at a loss.
Any help is greatly appreciated!
<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
<!--
body {
margin: 5px;
padding: 0px;
font-family: arial, sans serif;
font-size: 12px;
}
#page-wrapper {
width: 100%;
height: auto;
border: 0px solid black;
}
#nav {
margin: 0px 0px 0px 0px;
padding: 5px;
float: left;
width: 150px;
background: yellow;
}
#content {
margin: 0px 0px 0px 5px;
padding: 5px;
float: left;
width: 240px;
background: blue;
}
-->
</style>
</head>
<body>
<div id="page-wrapper">
<div id="nav">NAVIGATION</div>
<div id="content">
CONTENT<br />
CONTENT<br />
CONTENT<br />
CONTENT<br />
CONTENT</div>
</div>
</div>
</body>
</html>
I am having trouble getting the left div (navigation) to expand vertically as the right div (content) expands. Basically I want the yellow background to be the same height as the blue background, But I don't know the length of the content background because that is going to change on every page.
Using tables the cell expanded automatically as the content grew.
Can anyone help me with this? It seems like an easy and common thing to do, but I am at a loss.
Any help is greatly appreciated!
<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
<!--
body {
margin: 5px;
padding: 0px;
font-family: arial, sans serif;
font-size: 12px;
}
#page-wrapper {
width: 100%;
height: auto;
border: 0px solid black;
}
#nav {
margin: 0px 0px 0px 0px;
padding: 5px;
float: left;
width: 150px;
background: yellow;
}
#content {
margin: 0px 0px 0px 5px;
padding: 5px;
float: left;
width: 240px;
background: blue;
}
-->
</style>
</head>
<body>
<div id="page-wrapper">
<div id="nav">NAVIGATION</div>
<div id="content">
CONTENT<br />
CONTENT<br />
CONTENT<br />
CONTENT<br />
CONTENT</div>
</div>
</div>
</body>
</html>