Re: 2 column layout
- From: Mark <user@xxxxxxxxxxx>
- Date: Tue, 23 Oct 2007 10:57:49 +0100
dorayme wrote:
In article <5o38n9FksojqU1@xxxxxxxxxxxxxxxxxx>,
Mark <user@xxxxxxxxxxx> wrote:
dorayme wrote:In article <5o19bhFkbab6U1@xxxxxxxxxxxxxxxxxx>,
Mark <user@xxxxxxxxxxx> wrote:
Hi allYou could take a look at
I would like to create a simple two column layout - navigation on the left and content on the right. I would like the columns to have a fluid width so they can grow and shrink according to the size of the text and the browser window. However, I do not want the content column to span the entire available width ...
What is the best way to achieve what I want? Can I use some kind of max-width style on the content column? If so, how do I specify the width in CSS?
<http://netweaver.com.au/test/leftNavFloated.html>
Play about with this ...
For IE less than 7, which do not recognise this useful css instruction, there are other strategies. One is ...Hi dorayme
Thanks very much for your input.
I noticed one drawback with this method in that the navigation div has to precede the content div in the document - is there a way around this?
Yes, there are solutions to this. Perhaps you would like to follow:
<http://www.pmob.co.uk/temp/2colcentred_contentfirst.htm>
Personally, I think it is not a clear drawback to have the navigation first. There are arguments both ways. My view is that since there are good arguments both ways and the matter is hard to decide on the basis of them, just do whatever is simplest in any given design.
Another problem I have is, I decided to add a header div that should span the navigation and content divs, to achieve the layout below:
+-----------+
+header +
+--+--------+
| n| content|
| a| |
| v| |
+--+--------+
However, the header div will obviously span the width of the browser window if its width is not constrained somehow but how do I make it equal the two columns?
I can do this easily by simply putting everything inside a wrapper div and giving it a fixed width of 40em (say) but will this cause problems for people with very small viewports?
Bergamot has given a good answer on this as far as I can tell. Which reminds me that a while back he posted an interesting "dumbed down" version of a layout that you might be interested in. I simply cannot find it quickly but I know I played about with it a bit and have my version (probably with some impurities?) and I am happy to post it for you (I will take it down if the original reference is thought of):
<http://netweaver.com.au/test/bergamotColsNoFooter.html>
In a way, this layout has one major motive: of having "equal length" columns independent of content driven heights. It is a problem for some people that prefer not to use table layouts. But this is another matter. It happens also to address in part your interest in content first. It may appeal to you?
It seems excellent in Firefox. However, it has problems in IE7, or rather IE7 has problems with it:
http://www.lester1.eclipse.co.uk/screenshot.gif
This is triggered by resizing the browser window.
If I place a max-width rule on the container, do I then specify the width of the navigation and content columns in %?
.
- Follow-Ups:
- Re: 2 column layout
- From: dorayme
- Re: 2 column layout
- References:
- Re: 2 column layout
- From: Mark
- Re: 2 column layout
- From: dorayme
- Re: 2 column layout
- Prev by Date: Re: Border / Background inconsistent?
- Next by Date: Re: full height columns
- Previous by thread: Re: 2 column layout
- Next by thread: Re: 2 column layout
- Index(es):
Relevant Pages
|