0

Hi there everyone,

I have a site over here:

http://www.vikgfx.com

If you view it in a resolution of 1280 x 1024, the whole page would sit on the left side of the screen. I tried my level best to adjust the CSS but it just doesn't sit in the center.

Could anyone assist me in this? I designed that site in Photoshop and later sliced it and converted it into HTML/CSS but now the centering problem is bugging me a lot. You guys can view the source code of the site to check out the CSS/HTML.

Thanks in advance.

5
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by diafol
0

If you use table, always have outermost table with 100% width to adjust to the resolution whatever you want.
If you use CSS, I think you should have div for wrapper the content.

0

i'm not sure what your css looks like, but you will need two for IE and for FF:

if FF etc

body  {
    text-align:-moz-center;
    text-align:-khtml-center;
}

if IE

<!--[if IE]>

body  {
    text-align:center;
}

<![endif]-->
0

WRT text-align, this then makes all descendants align to the centre. You then need to set your wrapper div to "left" or "right", if your language is RTL. IF you use the margin solution, be aware that users with early versions of IE, require the text-align:center:

For a *fool-proof* solution:

body{
  text-align:center;
}
#wrapper{
  width:900px; /*this could also be a percentage - BUT be careful - use a min-width and max-width to avoid silly sizes*/ 
  text-align: left;
  margin: 0 auto;
}

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.