Connecting Tech Pros Worldwide Forums | Help | Site Map

Page align problem

Newbie
 
Join Date: Nov 2009
Posts: 3
#1: 3 Weeks Ago
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:relative;

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
best answer - posted by TheServant
Quote:

Originally Posted by bogfart View Post

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.

Newbie
 
Join Date: Nov 2009
Posts: 3
#2: 3 Weeks Ago

re: Page align problem


Ah. Is it from vertical scrollbar? Page that's looking OK doesn't have scroolbar, and page that's been "moving" have it.
?
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 919
#3: 3 Weeks Ago

re: Page align problem


When you say aligned > center, what do you mean?
I would not have:
Expand|Select|Wrap|Line Numbers
  1. margin-left:auto;
  2. margin-right:auto;
  3. position:relative;
to center a page/div, you should be using:
Expand|Select|Wrap|Line Numbers
  1. 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?
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 919
#4: 3 Weeks Ago

re: Page align problem


Quote:

Originally Posted by bogfart View Post

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.
Newbie
 
Join Date: Nov 2009
Posts: 3
#5: 3 Weeks Ago

re: Page align problem


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:
Quote:
margin: 0 auto;
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 919
#6: 3 Weeks Ago

re: Page align problem


No worries, hope to see you around more often.
Reply