Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Website wrapper is not aligning with auto margins
(1 viewing) (1) Guest
All your queries regarding CSS will be solved in this forum
  • Page:
  • 1
TOPIC:

Website wrapper is not aligning with auto margins

Website wrapper is not aligning with auto margins 1 year, 5 months ago #355

  • sandhya
  • OFFLINE
  • Senior Boarder
  • Posts: 42
  • Karma: 0
I have re-written the css and html twice now and I am out of ideas and googling results, anyone able to see the error in my code? The wrapper will not align the website in the center. Very grateful for any insight into the problem.

CSS Codespec:

body {
font-family: "Times New Roman", Times, serif;
font-size: 1em;
text-align:center;
}

h1, h2, h3 {
font-family: "Times New Roman", Times, serif;
font-size: 3em;
}

}

#wrapper {
text-align:left;
width: 900px;
margin-left: auto;
margin-right: auto;
}

#mainhead {
text-align: center;
width: 900px;
}

#navi {
float: left;
width: 148px;
margin-top:10px;
margin-bottom: 10px;
}

.navibox {
width:148px;
height: 25px;
margin-bottom: 2px;
}

#content {
float: left;
width: 718px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 10px;
padding: 10px;
}


HTML Codespec:

<html>
<head>
<l-ink href="cssstyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="mainhead">
<h1>Title</h1>
<h2>sub-heading</h2>
</div>
<div id="navi">
<div class="navibox">
</div>
<div class="navibox">
</div>
<div class="navibox">
</div>
<div class="navibox">
</div>
</div>

<div id="content">
<p> blah blah blah </p>
</div>

<div id="footer">
<p> blah blah </p>
</div>
</div>
</body>
</html>

Re: Website wrapper is not aligning with auto margins 1 year, 5 months ago #372

  • abraham
  • OFFLINE
  • Junior Boarder
  • Posts: 25
  • Karma: 0
In your CSS you have an extra }, before defining the #wrapper, approx. Line #26.

You should be declaring a doctype in your html as well. Other than that everything looks okay to me.
  • Page:
  • 1
Time to create page: 1.50 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download