Page align problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bogfart
    New Member
    • Nov 2009
    • 3

    Page align problem

    Hi all,

    In brief, this is what's happening (very annoying):

    - I made 5 HTML/CSS pages coding them by hand;
    - First I made one page and I used that page for making other pages, just with small changes in text;
    - All pages are aligned > center:
    margin-left:auto;
    margin-right:auto;
    position:relati ve;

    What's the problem then?

    I noticed that, from 5 pages, 2 pages are centered but they are moved into left for a couple of pixels (3-4-5px). They all use same CSS, with changes in text only (in HTML ofcourse).

    Does anyone knows what seems to be a problem here?
    Really annoying!!!

    Thanks
  • bogfart
    New Member
    • Nov 2009
    • 3

    #2
    Ah. Is it from vertical scrollbar? Page that's looking OK doesn't have scroolbar, and page that's been "moving" have it.
    ?

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      When you say aligned > center, what do you mean?
      I would not have:
      Code:
      margin-left:auto;
      margin-right:auto;
      position:relative;
      to center a page/div, you should be using:
      Code:
      margin: 0 auto;
      Are you sure you're pages aren't moving simply because the scroll bar is appearing on some? Do you define your containing widths or are they auto? Do you use any different tags in the ones that work and those that don't?

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        Originally posted by bogfart
        Ah. Is it from vertical scrollbar? Page that's looking OK doesn't have scroolbar, and page that's been "moving" have it.
        ?
        Yeah, you can look into your "overflow" CSS attribute to play around with how that works if it's bothering you.

        Comment

        • bogfart
          New Member
          • Nov 2009
          • 3

          #5
          That's it definitely. I just didn't realized, so it looked logical to me to be some problem in the code, but it's not.
          Thanks for confirming it and advice about:
          margin: 0 auto;

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            No worries, hope to see you around more often.

            Comment

            Working...