Link to home
Start Free TrialLog in
Avatar of pigouvian
pigouvian

asked on

CSS layout for header, footer, 2-column body w/ nested content

I am having issues in producing a layout using CSS only.  I would be grateful if one of the many CSS gurus in the community would help point me in the direction for creating a stylesheet that accomplishes my goal and remain cross-browser compatible.  Convention would suggest I post the code developed to this point.  But to be honest, I have found I do not have a clue as to what I am doing.  Further, in the process of synthesizing others code that achieves some of what I need to accomplish, my lack of skill has created a product that is a discordant and disparate mess of otherwise good code.  As such, please accept my humble apologies for not posting what I have created thus far.
 
The Goal:  Create a fixed header and footer that span the entire width of the top and bottom of the viewport, respectively.  In the remaining area would be two surrounds:  one for navigation and one for content.  The nav container would be 175px wide and 100% the remaining height; while the content container would occupy the remaining area.  Within the nav container would be a nested div that has a margin of 3px, a 1px black border and occupy 100% width and height of the nav container; any overflow would be hidden.  Within the content container would be a nested div that has a margin of 3px, a 1px black border, and occupy 100% width and at minimum 100% height of the content container.  Any overflow would spawn a vertical scrollbar over the content container.  

In the event my description was not clear, a GIF of the layout is available at http://www.propagranda.com/images/website_layout.gif.  Thank you in advance for the help.
Avatar of GrandSchtroumpf
GrandSchtroumpf

Avatar of pigouvian

ASKER

Thanks GrandSchtroumpf for your reply.  I have gotten to this point, but am unable to get the DIVs that are nested in the nav and content surrounds that will contain the content to expand 100% width and height (less 3px margin).  Any thoughts?
> but am unable to get the DIVs that are nested in the nav and content surrounds that will contain the content to expand 100% width and height (less 3px margin).
That's perfectly normal that you are unable to do it.
You can try something with min-height, but i have no idea how you'll be able to have mixed units (percentage minus pixels)...  And good luck if you need that to work in IE.
Another solution is to use javascript to resize your elements (or use an expression in IE).
But the best solution is to you adapt your layout to something that does not go against the fundamental principles of the CSS layout.
Just to make sure I understand correctly, it is not possible to nest one DIV in another DIV, set the margin of the inner DIV to 3px, and have it fill the area of the outer DIV?  You are right that I probably don't understand the principles of CSS -- so I have a related question.  Are the parameters I set for the inner DIV relative to the dimensions of the outer DIV?
ASKER CERTIFIED SOLUTION
Avatar of GrandSchtroumpf
GrandSchtroumpf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial