Site center but with space between top of thebrowser

liunx

Guest
I followed the tutorial but my site is sticking to the top of my browser window. I don't want this to happen. I want my site to be totally centered. How do I do this? Here is my code for my wrapper:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#wrapper {<br /><br />    width: 814px;<br /><br />    margin: 0 auto;<br /><br /><br />    height: auto;<br /><br />    <br /><br /><br />}<!--c2--></div><!--ec2--><!--content-->
If you are wanting a VERTICALLY and HORIZONTALLY centred site, the><img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->If you are wanting a VERTICALLY and HORIZONTALLY centred site, the target="_blank">http://www.oswd.org/design/preview/id/3548<!--content-->
so you just want a gap at the top?<br /><br />If so then in the body part of the css (if you have><img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->Hi, Think this is what you might be after:<br /><br />margin-left: auto;<br />margin-right: auto;<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br />That is exactly the same as saying:<br /><br />margin: 0 auto;<br /><br /><br />the 0 in that bit of code is for top and bottom and the auto is for the left and right, so your bit of code is just a longer way of saying what is already being said in the code already <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br /><!--content-->
<!--quoteo(post=18459:date=Dec 4 2007, 15:53:name=Dizi)--><div class='quotetop'>QUOTE(Dizi @ Dec 4 2007, 15:53) <img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->That is exactly the same as saying:<br /><br />margin: 0 auto;<br />the 0 in that bit of code is for top and bottom and the auto is for the left and right, so your bit of code is just a longer way of saying what is already being said in the code already <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Really dam I been doing it some backwards way I think its time to update my stylesheet lol<!--content-->
In that case, <br /><br />margin: 10 auto;<br /><br />will do the trick!<!--content-->
<!--quoteo(post=18462:date=Dec 4 2007, 15:57:name=seige)--><div class='quotetop'>QUOTE(seige @ Dec 4 2007, 15:57) <img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->In that case, <br /><br />margin: 10 auto;<br /><br />will do the trick!<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br /><br />That depends style="vertical-align:middle" emoid=":p" border="0" alt="tongue.gif" /><!--content-->
!!!<br /><br />Of course you would, stops the dreaded 'empty <BR> to pad a long page' being needed <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /><!--content-->
i tought that gap at the top and bottom was set by default till you set it to margin: 0 auto;<br /><br />maybe i was on mush))<!--content-->
 
Top