收录日期:2020/12/05 04:09:25 时间:2010-09-07 20:31:22 标签:css

I'm currently redesigning a website and have run into an issue with horizontal scrolling when the page is viewed in a narrow browser window.

The header contains a logo, some text and a navigation bar and spans 100% of the page width, but the header content is centered with a fixed width of 940px. When shown properly, it looks like this:

Normal

However, if the browser window is resized to be narrower than the fixed width a horizontal scrollbar appears (as expected), but scrolling it 'cuts' the scrolled part out, producing the following result:

Scrolled

The work-in-progress site can be viewed live here, if the CSS/HTML can give you any hints as to what I'm doing wrong.

The easiest way to fix this problem is to add min-width:940px to the body tag and use an expression for ie6.

It works fine for me in Firefox 3.6.8, IE 8, and Chrome 5. What browser are you using? Looks like you are using Chrome.

Is the page being cached in your browser incorrectly? Try clearing your cache and then check the site, or try viewing it on another computer. The CSS for the header is straightforward and correct. Nothing there should be causing problems.