257 posts
  • 6 Years of Membership
  • Author Level 4
  • Exclusive Author
  • Most Wanted Winner
+2 more
Morad
says

Hello everyone here, i hope you be ok. I have a question and i hope you help. I made a HTML web page and when changing thr resolution of screen more than 1024 768, the whole page content goes to left like in resolution 1280 1024 and here the image url on resolution 1280 1024 http://img225.imageshack.us/img225/6927/theproblem.png

and the web page is fit only on resolution 1024 768 or less.

I made body{margin:0 auto; top:0px ;left:0px} but not fixed. I hope you help me with this.

Thanks too much.

125 posts
  • 6 Years of Membership
  • Affiliate Level 3
  • Author Level 1
  • Collector Level 4
+2 more
Eight7Teen
says

Normally it’s not a good idea to adjust the position of the “body” itself…

Instead, you should adjust the position of your wrapper/container DIV that the content is placed in.

As far as centering it no matter what the screen resolution, you’re on the right track, but making one mistake: You must give the container/element that you want to center an explicit width so that the browser can then measure the width of the window vs. the width of the element and center it accordingly.

213 posts
  • 6 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 4
+3 more
snaz3d
says

You can’t center the body.

you have to create a container, which I’d recommend you to size it 960px;

- #container { clear:both; float:none; width:960px; margin:0 auto; }

like this, and in #container you will insert all the content and stuff.

This is the way to do it if you want to center it.

257 posts
  • 6 Years of Membership
  • Author Level 4
  • Exclusive Author
  • Most Wanted Winner
+2 more
Morad
says

ya, this really helped me.Thanks too much Eight7Teen and snaz3d.

It’s now ok after your reply.Thanks for help.

213 posts
  • 6 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 4
+3 more
snaz3d
says

No problem :)

by
by
by
by
by
by