...

View Full Version : Width: 100% - 185px



Michiel
10-25-2004, 09:49 AM
Hi there,

again I'm in need of help with some CSS positioning. Below you'll find a snippet of my css and the according html. What I'm trying to achieve is that the menu-div and the content-div end up right next to each other and the content-div fils all the remaining space. So actually the content-div should be 100% - 185px wide. How to do such a thing?

CSS:




#main {
width: 100%;
background: url(./graphics/main2.jpg) no-repeat right bottom;
}

#menu {
height: 300px;
width: 185px;
padding-top: 1px;
padding-left: 20px;
float: left;
background: url(./graphics/menu.jpg) no-repeat;
}

#content {
float: left;
height: 375px;
background: url(./graphics/main_background.jpg) no-repeat;
}


HTML:



<div id="main">
<div id="menu">
MENU
</div>
<div id="content">
CONTENT
</div>
</div>


Thanx for your help! Michiel

ronaldb66
10-25-2004, 10:21 AM
Since your menu is in front of the content in the source already, I'd sugggest to not float the content at all, but leave it at auto width (corrections for IE may apply) and give it a proper margin to make room for the menu.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum