Forum Moderators: not2easy

Message Too Old, No Replies

Help! How to Get Left Nav to Always Touch Header and Footer?

         

pab1953

5:31 pm on Jan 27, 2009 (gmt 0)

10+ Year Member



I've got a simple enough site but an annoying problem I can't solve.

The site: Header, footer, left nav, main content.

Problem: How do I get the left nav to always touch (abut) both the header and the footer?

Actually, abutting the header is no problem. It's the footer that's the problem.

Right now I'm using a monstrous string of these:

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

But there must be a better way. Plus this doesn't always work.

I've tried setting a Height attribute. This sort of works -- but not equally in IE and FF.

Suggestions?

swa66

1:00 pm on Jan 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming the nav is floated, the footer has a clear etc.

You can't do it directly as it means you want the sidebar to have the same (unspecified) height as the main content has.

Solutions are either javascript to set the height, or to fake it:

Make sure the nav and main content have a common parent
Make sure the parent stretches to the longest element inside it (use a <br> with a clear on it if you need to) and style that to have fake columns.