emorgoch
12-15-2006, 04:06 PM
So I'm trying to create for myself a header + two column layout with CSS, and I'm having some severe difficulties. I've spent 3 days researching on the web, looking at various people's CSS designs, and none of them have matched the layout I'm looking for.
The idea of the layout is as follows:
1) Fixed height header that spans across the whole top of the viewport
2) A fixed width sidebar
3) A variable content area that spans the rest of the viewport
Both the sidebar and content areas should have variable heights, taking the max of either the remaining veiwport height (content of both sidebar & content is less than viewport area), the height of the sidebar (sidebar is longer than content & viewport), or the height of the content (content long than sidebar or viewport).
I've managed to create a near-working page that meets this criteria using a table, but it has two flaws in it:
1) If a DOCTYPE is declared, both IE 6 and 7 make the header a variable height, reaching as much as 50% of the viewport length of there's no content
and
2) It uses tables to outline the layout, as opposed to a pure CSS approach, which (to my understanding), is the standard that should be attempted these days.
I've put my sample up here (http://emorgoch.no-ip.com/PageSample/) which you can use to show the functionality I'm looking for, download the source for the sample here (http://emorgoch.no-ip.com/PageSample/Default.txt).
Oh, and one last condition: This is for an internal intranet site that uses ASP.NET, so atleast the sidebar & content areas need to be encapsulated in a <form runat="sever"> tag.
Many thanks for the much appreciated help guys.
The idea of the layout is as follows:
1) Fixed height header that spans across the whole top of the viewport
2) A fixed width sidebar
3) A variable content area that spans the rest of the viewport
Both the sidebar and content areas should have variable heights, taking the max of either the remaining veiwport height (content of both sidebar & content is less than viewport area), the height of the sidebar (sidebar is longer than content & viewport), or the height of the content (content long than sidebar or viewport).
I've managed to create a near-working page that meets this criteria using a table, but it has two flaws in it:
1) If a DOCTYPE is declared, both IE 6 and 7 make the header a variable height, reaching as much as 50% of the viewport length of there's no content
and
2) It uses tables to outline the layout, as opposed to a pure CSS approach, which (to my understanding), is the standard that should be attempted these days.
I've put my sample up here (http://emorgoch.no-ip.com/PageSample/) which you can use to show the functionality I'm looking for, download the source for the sample here (http://emorgoch.no-ip.com/PageSample/Default.txt).
Oh, and one last condition: This is for an internal intranet site that uses ASP.NET, so atleast the sidebar & content areas need to be encapsulated in a <form runat="sever"> tag.
Many thanks for the much appreciated help guys.