I currently have my layout for my pages set through my CSS (and thanks for the previous help on this as I now think I understand layout in CSS!).
Here's my CSS
And here's my HTML code:
Its a bit of a long way round for a shortcut, but I want to know how I can have the middle section height to be dynamic?
So that's the 'workarea' div and the divs contained within that. Obviously the 'pagenav' div is a left hand div that I want to extend to the full length of the 'workarea'.
The 'pagecontentimage' is fixed height/width but the 'pagecontent' div needs to be dynamic depending on the content. Is that possible?
So if I have a little peice of content (text) in this div I would like a minimum height but if this contains a lot of content I want this to expand to show everything and also for the 'pagenav' to expand to the height as well. Does that sound clear?
The content is pulled from a database so I have no idea (to a certain extent) how much data I will put into these divs.
At the moment, the 'workarea' is a fixed height as are the other divs in that div.
Here's my CSS
Code:
.main {
width: 1024px;
margin: 0 auto;
}
.topbar, .menubar {
position: relative;
}
.logo {
width: 720px;
height: 150px;
background-image: url(header.jpg);
}
.basket {
width: 298px;
height: 150px;
position: absolute;
top: 0px;
left: 726px;
background-color: #999999;
color: #FFFFFF;
}
.basket div {
margin-top: 25%;
padding: 5px 5px;
}
.menubar {
height: 40px;
}
.menubar ul {
list-style-image: none;
list-style-position: outside;
list-style-type: none;
margin: 0px;
padding: 0px;
margin-top: 5px;
}
.menubar ul li {
font-family: arial;
font-size: 1.5em;
color: #FFFFFF;
width: 13.7%;
height: 40px;
line-height: 40px;
background-color: #999999;
text-align: center;
float: left;
margin: 3px 3px;
}
.menubar li:hover {
background-color: black;
}
.workarea {
clear: both;
width: 1024px;
height: 100%;
position: relative;
margin: 10px 0px;
background-color: #FFFFFF;
}
.pagenav {
float: left;
width: 225px;
background-color: #AAAAAA;
height: 590px;
font-family: arial;
font-size: 1.5em;
padding-left: 10px;
padding-top: 10px;
color: #FFFFFF;
}
.pagecontentimage {
width: 100%;
height: 200px;
background-color: #123456;
}
.pagecontent {
width: 759px;
background-color: #FFFFFF;
height: 400px;
margin: 10px 10px;
}
.copyright {
font-family: arial;
font-size: 14px;
text-align: center;
clear: both;
color: #FFFFFF;
background-color: #999999;
padding: 5px 5px;
}
And here's my HTML code:
Code:
<div class="main">
<div class="topbar">
<div class="logo"></div>
<div class="basket">
<div>Basket</div>
</div>
</div>
<div class="menubar">
</div>
<div class="workarea">
<div class="pagenav"></div>
<div class="productcontent">
<div class="pagecontentimage"></div>
<div class="pagecontent"></div>
</div>
</div>
<div class="copyright">footer</div>
</div>
Its a bit of a long way round for a shortcut, but I want to know how I can have the middle section height to be dynamic?
So that's the 'workarea' div and the divs contained within that. Obviously the 'pagenav' div is a left hand div that I want to extend to the full length of the 'workarea'.
The 'pagecontentimage' is fixed height/width but the 'pagecontent' div needs to be dynamic depending on the content. Is that possible?
So if I have a little peice of content (text) in this div I would like a minimum height but if this contains a lot of content I want this to expand to show everything and also for the 'pagenav' to expand to the height as well. Does that sound clear?
The content is pulled from a database so I have no idea (to a certain extent) how much data I will put into these divs.
At the moment, the 'workarea' is a fixed height as are the other divs in that div.