...

View Full Version : CSS Nav/Content Question



rishid
05-04-2006, 06:52 PM
Hi,

Trying to have a fixed width navigation menu of say 150px on the left side, then a content div that fills up the rest of the screen regardless of the resolution.

This is what I have below, but cannot figure out how to get the #content div to fill the rest of the screen.

Can this be done in CSS?

Thanks,

RishiD



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Blah</title>
<style type="text/css">
#wrapper {
width: 100%;
margin: 10px auto;
}
#categories {
width:150px;
padding:5px 5px;
}
#content {

float:left;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="categories">
THIS IS THE NAV
</div>
<div id="content">
THIS IS THE MAIN CONTENT
</div>
</div>
</body>
</html>

betoranaldi
05-04-2006, 07:06 PM
I'm not sure I totally understand what you are looking for but this might help.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Blah</title>
<style type="text/css">
#wrapper {
width: 100%;
margin: 10px auto;
}
#categories {
width: 150px;
float: left;
padding: 5px;
}
#content {
margin: 0px 0px 0px 165px;
padding: 5px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="categories">THIS IS THE NAV </div>
<div id="content">THIS IS THE MAIN CONTENT</div>
</div>
</body>
</html>

rishid
05-04-2006, 07:11 PM
Yep that is what I thought of as a workaround.

Thanks

#categories {
width: 7em;
float:left;
}
#content {
margin-left: 7em;
padding-left:5px;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum