Jump to content


horizontal centering using


3 replies to this topic

#1 Wazzup

    Young Padawan

  • Members
  • Pip
  • 217 posts

Posted 15 February 2006 - 02:54 PM

Hey,

i wanted my site to be horizontally centered and i used the tutorial at the following website:

www.quirksmode.org/css/centering.html

I followed it exactly, and applied to my website, but it still doesnt center horizontally, i did it over again bout 6 times, but cant figure out what i did wrong. My website is now like this: http://members.chell.../portfolio_site can someone please look at the code and tell me what i did wrong? im desperate. And i know it now looks fine when looked at 1024 res but it has to look nice atwell at higher res.

thanks, Snuur

#2 greg

    Jedi In Training

  • Members
  • PipPip
  • 499 posts
  • Location:New York City
  • Interests:Fine art, web and graphic design, naval architecture, chess, and sports.

Posted 15 February 2006 - 03:16 PM

First of all, that's a pretty crappy tutorial. I wouldn't follow any tutorial that uses the word "fixedness."

Second, it seems like it's already centered in IE and Firefox, so I don't see what the problem is. You can try the method which I usually use:
#wrap {
width: 600px;
margin: 0 0 0 50%
position: relative;
left: -300px;
}
If you change the width, make sure to change the "left" property to half of it.

Third, have you taken a look at your page in IE? IE doesn't allow transparencies in .png files.

#3 Wazzup

    Young Padawan

  • Members
  • Pip
  • 217 posts

Posted 15 February 2006 - 04:10 PM

yes its centered horizontally, and in 1024 resolution it seems to be centered vertically aswell. but it isnt, it sticks to the top of the page. should be solved using that tut, but it didn't. and i dont really understand your method.

#4 greg

    Jedi In Training

  • Members
  • PipPip
  • 499 posts
  • Location:New York City
  • Interests:Fine art, web and graphic design, naval architecture, chess, and sports.

Posted 15 February 2006 - 11:51 PM

So the problem is vertical centering, not horizontal as you first said? Add this to your css:

body {
vertical-align: middle;
}






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users