I'm looking to rewrite a TABLE heavy site using CSS for the layout instead - but I'm having trouble getting my head around it, especially the type of positioning I should be using.
I would like to have the following layout...
-----------------------------------
| HEADER |
-----------------------------------
| | |
| | |
| LEFT | MAIN |
| | |
| | |
| | |
-----------------------------------
| FOOTER |
-----------------------------------
HEADER, FOOTER and MAIN should fill the available width of the page.
LEFT should have a fixed width.
HEADER and FOOTER should have fixed heights.
LEFT and MAIN should fill the remaining available height of the page.
I have tried the following code but am getting unwanted scrollbars. I believe this is due to the 100% I have used for the LEFT (height) and MAIN (height and width). It seems to to allocating 100% of the total window rather than 100% of what's left over.
myPage.htm
Tony
________________________________________________________________________________
I would like to have the following layout...
-----------------------------------
| HEADER |
-----------------------------------
| | |
| | |
| LEFT | MAIN |
| | |
| | |
| | |
-----------------------------------
| FOOTER |
-----------------------------------
HEADER, FOOTER and MAIN should fill the available width of the page.
LEFT should have a fixed width.
HEADER and FOOTER should have fixed heights.
LEFT and MAIN should fill the remaining available height of the page.
I have tried the following code but am getting unwanted scrollbars. I believe this is due to the 100% I have used for the LEFT (height) and MAIN (height and width). It seems to to allocating 100% of the total window rather than 100% of what's left over.
myPage.htm
Code:
<html>
<head>
<title>Test Page</title>
<style>
body {margin: 0px; padding: 0px; background-color: #FFFFFF;}
div.header {position: absolute; top: 0px; width: 100%; height: 35px; background-color: #003399;}
div.left {position: absolute; top: 35px; width: 160px; height: 100%; background-color: #993300;}
div.main {position: absolute; top: 35px; left: 160px; width: 100%; height: 100%; background-color: #CEE3E6;}
div.footer {position: absolute; bottom: 0px; width: 100%; height: 25px; background-color: #003399;}
</style>
</head>
<body>
<div class="header">
header text
</div>
<div class="left">
left text
</div>
<div class="main">
main text
</div>
<div class="footer">
footer text
</div>
</body>
</html>
Tony
________________________________________________________________________________