Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Outer container within html body (w/ left, right margin set to auto) shifting left on certain pages.

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39852
    carmbo
    Member

    At farfallasoap.com, the main container within the html body is shifted left slightly on some of the pages. I used #body-inner {width:975px; margin:10px auto; color:#686868} although I’m not sure if the problem is related to that or not. May be the equal height 2 column layout technique (http://matthewjamestaylor.com/blog) I used in the 2nd row. Not sure. Took out my header (1st row) and it fixed on some pages but not all. Very confusing. Any ideas?

    #110091
    Paulie_D
    Member

    It’s the old scrollbar problem. Some pages are long enough to have a scrollbar and some aren’t.

    The easiest way to fix it is to set your html to always have a scrollbar


    html {overflow-y: scroll;}
    #110092
    Taufik Nurrohman
    Participant

    It ‘s likely happen because there is something you float, whether it’s a header or footer. For the example, if your header (or an element right above the #body-inner) is floated to the left, this may cause your #body-inner shift to the right.

    Try to fix your layout by adding something like clear:both; or display:block;

    #body-inner {
    clear:both; /* here! */
    width:975px;
    margin:10px auto;
    color:#686868;
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.