views:

53

answers:

1

I have a layout of fixed-pixel width (960px) with a navigation bar that has five items in it. The width of the nav div is set to 100%, but its content ends up taking exactly 960px. The navigation is a bit complicated with a set of drop-downs and links. The problem is that zooming the page out at all causes the navigation bar to get clipped and move on to the next line.

Anyone have tips for how to avoid this?

Thanks a lot.

A: 

The only sure way I've found to do it is by defining all padding and widths using 'em'. This means everything will be relative to the font size and expand/contract smoothly as you change font sizes in the browser.

Here's a simple template I put together years ago that does the trick.

Since most browsers now zoom instead of only change font size, it's not as much of a concern, but older ones like IE6 still need a little help.

Pat