April 11, 200917 yr Hi All, I've put a wrapper on my site to centre it & everything seems to have worked. I have an issue however with the body (h2 plus the content. For some reason there appears to be a margin, so the body has shifted over about a third of the page. The width is fine. It's got me stumped! Any help would be much appreciated. CSS: * { margin: 0; padding: 0; } body { font-family: Verdana, Helvetica, Arial, sans-serif; background-color: #cc9933; <!--margin colour--> background- repeat: no; bakground position: bottom left; background-attachment: fixed; line-height: 125%; padding: 0px; margin: 0px; text-align: left; colour: #FFccCC; } #wrapper { background-color: #FFcc99; <!--main body colour--> border: 1px solid #ff9933; position: relative; margin: 0 auto; padding: 0px; width: 960px; text-align: left; } #content_wrapper { margin: 0px; width:960px; height:900px; background-image: url(content.gif); background-repeat: repeat-y; border-bottom: 10px solid #ff0033; text-align: left; } #bodycontent { margin: 0px; padding-left: 0px; text-align: left; } h1, h2, h3 { font-family: "Trebuchet MS", Helvetica, Arial, sans-serif; } h1 { font-size: x-large; background-color: navy; color: white; padding-top: 3em; padding-bottom: .2em; padding-left: .4em; margin: 0px; background: #663300; <!--header colour--> border: 1px solid #ff9933; } h2 { color: navy; font-size: 130%; font-weight: normal; padding-top: 70px; padding-left: 5px; text-align: left; margin: 0px; width: 960px; z-index: 0; border: 1px solid #ff9933; } .post-body div, p { font-size: small; color: navy; padding-left: 5px; padding-top: 5px; } #tagline p { font-style: italic; font-family: Georgia, Times, serif; border-top: 1px solid #99cc33; border-bottom: 1px solid #99cc33; padding-top: .5em; padding-bottom: .5em; padding-left: .8em; margin: 0px; background: #99cc33; border: 1px solid #ff9933; } HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Ivywell Alpacas - Home Test</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <link href="testing.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="wrapper"> <div id="header"> <div id="sitebranding"> <h1>Ivywell Alpacas</h1> </div> <div id="tagline"> <p>Defining the future...</p> </div> <!-- SiteSearch Google --> <div id="search"> <form method="get" action="http://www.google.com/search"> <label for="q">Search:</label> <input id="q" name="q" size="20" maxlength="255" value="" type="text"/> <input name="domains" value="http://www.ivywell.co.uk/"'>http://www.ivywell.co.uk/" type="hidden"/> <input name="sitesearch" value="http://www.ivywell.co.uk/" checked="checked" id="mysite" type="radio"/> <label for="mysite">Just this site</label> <input name="sitesearch" value="" id="www" type="radio"/> <label for="www">WWW</label> <input name="btnG" value="Go" type="submit"/> </form> </div> </div> <!-- end of header div --> <div class="menu"> <ul> <li><a href="../menu/index.html">HOME<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <li><a href="../menu/index.html">ABOUT US<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="../menu/embed.html" title="Our aims & objectives">Our goals</a></li> <li><a href="../menu/form.html" title="Shows, workshops & courses">Events</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="index.html">ALPACA INFO<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="spies.html" title="Explanation of what an alpaca is">What are alpacas?</a></li> <li><a href="vertical.html" title="An overview of the alpaca standard">Alpaca facts</a></li> <li><a href="expand.html" title="How to look after alpacas">Care & husbandry</a></li> <li><a href="enlarge.html" title="Reasons for keeping alpacas">Why keep alpacas</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="../layouts/index.html">IVYWELL HERD<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="../layouts/body4.html" title="Our success in the ring">Show success</a></li> <li><a href="../layouts/bodyfix.html" title="Studs services available">Studs</a></li> <li><a href="../layouts/body2.html" title="Our core herd of breeding females">Females</a></li> <li><a href="../layouts/body5.html" title="Photo's of our herd">Gallery</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="../boxes/index.html">SERVICES<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="spies.html" title="Alpacas currently available for sale">Alpacas for sale</a></li> <li><a href="spies.html" title="Clothing range made from alpaca fleeces">Alpaca knitwear</a></li> <li><a href="vertical.html" title="Alpaca equipment & supplies">Alpaca supplies</a></li> <li><a href="expand.html" title="Support for establishing & running a successful alpaca business">Business support</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="../boxes/index.html">LINKS<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="../mozilla/index.html">CONTACT US<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="spies.html" title="Directions">How to find us</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> </div> <div id="content_wrapper"> <div id="bodycontent"> <h2>Welcome to the home of Ivywell Alpacas</h2> <p>Welcome to the site of Ivywell Alpacas. blah blah blah. </p> <p><img src="Gallery/Brooke.jpg" class="feature" width="200" height="162" alt="a circle of divers practice their skills"/></p> </div> <!-- end of bodycontent div --> </div> </div> <!--wrapper--> </body> </html>
April 11, 200917 yr i'm unsure if this is the cause but the width of your h2, plus its padding and border, equals 967px. that's 7px wider than your containing div. total width includes borders, padding and margins. might be easier to solve your problem if you have a url for the site.
April 11, 200917 yr Author Many thanks for your reply. Whilst you are correct about the total width being 967px, i've changed that but still no luck with the left indentation. Any other suggestions?
Create an account or sign in to comment