November 9, 200817 yr I cant center my site..... i have absoluted some divs please advise what 2 do. html{ overflow: auto; margin:auto; } body{ margin: 0; padding: 0; font-size: 90%; font-family: "Franklin Gothic Book"; color: #666666; text-align:center; background-image:url('images/trbg.png'); background-repeat: repeat-x; } #footer { position: absolute; width: 600px; height: 60px; top: 560px; margin: 0 auto; width: 800px; text-align:center; } #logoContent { position: absolute; width: 301px; height: 150px; z-index: 2; left: 282px; top: 4px; text-align:center; } .footer { color:#666666; text-align:center; font-family:inherit; } #contentMain { position: absolute; width: 598px; height: 409px; z-index: 3; left: 155px; top: 146px; } h1 { font-family: "Franklin Gothic Book"; font-size: 17pt; color: #39aeae; text-align:center; }
November 9, 200817 yr Use a wrapper, these act as drawing boards for all your content to go in. So something like this: body { text-align:center; } #wrapper { margin: 0 auto; width: xxxx; /* Replace the xxxx with the the width of your site (eg 800px)*/ text-align:left; } Then for the HTML: <div id="wrapper"> <!-- Place everything you want to be centred here--> </div> Should do the trick hopefully.
November 9, 200817 yr try changing body{ margin: 0; to body{ margin: 0 auto; hope that works for you.
Create an account or sign in to comment