views:

317

answers:

1

I'm doing some tests on a website using Wordpress as a CMS. In the example below the top left of the page has an "S" graphic outside of the main content area, clipped accordingly depending on the browser width. I would like to do something similar with an "L" graphic to the right in the footer.

The page width is set to 960px, and I've made the footer container DIV 1088px so that the "L" appears outside the content area. The trouble is this makes a scrollbar appear when it exceeds the current width of the browser.

I've tried overflow:hidden on the footer container DIV but this doesn't seem to work. I've also tried overflow:hidden on the BODY element and this works ok in IE, but not in other browsers.

Example: http://unclemort.com/wp/

I really hope there is away to do this, any help gratefully received.

A: 

Try in style.css, line 65, adding:

#footer-container {
    border: none;
    overflow: hidden;
}

Explanation:

#footer-container #footer {
    background: #f5e8f7 url('images/slobraico-footer-pink-full.gif') no-repeat top left;
    width: 1088px;      
    height: 217px;  
    overflow: hidden;   
    }

The scrollbar you're hiding is effectively not there. The scrollbar you're seing is another one. The problem is that the footer is 1088px wide, and that's causing a scrollbar to appear.

As long as the footer has fixed width and it's parent doesn't have overflow: hidden, you'll get a scroll if there's not enough width for the footer to fit. Same goes for any other container.

ANeves
Hi thanks for the quick reply. I've tried putting overflow: hidden in both the footer-container and footer div but this just chops of the right part of the footer outside of the main content (beyond 960px)What I have now done is put overflow-x: hidden; and overflow-y: auto in the BODY style element and this seems to have worked - the only issue now being how backward compatible these attributes are with other browsers?
Actually overflow-x: hidden on the BODY is probably not a good idea as it hides scrollbars when the browser window is resized or smaller than my site page width (960px). Still looking for an answer!
Well, yes it does chop - as expected. It hides the overflow, which is what it was told to do.What if you put the background image aligned right, instead of left? Wouldn't that work for you?See:http://www.htmldog.com/reference/cssproperties/background/http://www.htmldog.com/reference/cssproperties/background-position/(Yes, overflow:hidden on body has terrible effects.)
ANeves