![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi all 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 of the page (minus the navigation) if the viewport resolution is such that the content column would end up having very long lines. This is because I personally find narrow-ish columns much more comfortable to read, and I'm sure this is a common view. 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? |
#2
| |||
| |||
|
|
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? |
#3
| |||
| |||
|
|
dorayme wrote: In article <5o19bhFkbab6U1 (AT) mid (DOT) individual.net>, Mark <user (AT) example (DOT) net> wrote: Hi all 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? You could take a look at 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? |
|
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? |
#4
| |||
| |||
|
|
dorayme: Mark: dorayme: Mark: 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 %? |
![]() |
| Thread Tools | |
| Display Modes | |
| |