title: How do I center a container in my HTML/CSS?
body: <p>I have developed a website as part of my assignment. As I am new to html/css I could not figure some problems out of my code. The assignment specifications says that the screen size should be in certain size so that majority browsers can open it and the user should not experience any scroll activties. So I have used div to divide the whole page to fit the size. However, the container(In my code named as 'box') is set to the left side of the brower body and I have to set it centred, but I do not know how to fix it. Can anyone give me some help, please and thank you.</p>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;habibe Naby&lt;/title&gt;
  &lt;link rel="stylesheet" href="Websystems.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="box"&gt;
      &lt;div id="header"&gt;
       &lt;img id="image" src="spring.jpeg"&gt;
       &lt;p id="text"&gt;Welcome to My Homepage&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;div id="under"&gt;
              &lt;div id="upper"&gt;
                      &lt;div id="leftbar"&gt;
                              &lt;div class="list"&gt;
                              &lt;ul&gt;
                                      &lt;li&gt;&lt;a href="../index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
                                              &lt;li&gt;&lt;a href="past.html"&gt;Past&lt;/a&gt;&lt;/li&gt;
                                              &lt;li&gt;&lt;a href="future.html"&gt;Future&lt;/a&gt;&lt;/li&gt;
                                              &lt;li&gt;&lt;a href="comments.html"&gt;Comments&lt;/a&gt;   
  
                                      &lt;/li&gt;
                               &lt;/ul&gt;
                              &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div id="rightbar"&gt;
                      &lt;div  id="title"&gt;Habibe Naby&lt;/div&gt;
                         &lt;p&gt;this is my name and                           
  
                          I&lt;spanclass="special"&gt;Danny&lt;/span&gt;.Ihave    a .. &lt;/p&gt;
                      &lt;/div&gt;
              &lt;/div&gt;
    &lt;div id="footer"&gt;copyrights&amp;copy&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>My CSS:</p>
  
  <pre><code>body
  {
      height: 750px;
      margin: 2px;
      padding: 2px;
      width: 1000px;
  }
  
  
  #box 
  {
      width: 1000px;
      margin-left: auto;
      margin-right: auto;
      height:100%;
      border:1px solid #8D8D8D;
  }
  
  
  #header 
  {
      height: 150px; 
      width: 100%;
      position: relative;
  }
  
  
  #image 
  {
      height: 150px; 
      width: 1000px;
  }
  
  
  #text 
  {
      z-index: 100; 
  position: absolute;    
  color: darkolivegreen; 
      font-style: italic;
  font-size: 32px;
  font-weight: bolder;
  left: 300px; 
  top: 25px;
  }
  
  #leftbar
  {
      float: left;
      width: 200px;
      height: 560px; 
      margin: 0px;
      padding: 0px;
      background-color: azure;
  }
  
  .list
  { 
      margin-top: 40px;
      margin-left: auto;  
      text-decoration: underline;
      color:blueviolet; 
      font-size: 20px; 
  }
  
  
  .list ul 
  {
      list-style: none; 
  }
  
  #rightbar 
  {
      float: right;
      width: 800px;
      height: 560px;
      margin: 0px;
      padding: 0px;
      background: mintcream;
  }
  
  #title 
  {
      margin-left: 80px; 
      margin-top: 30px;
      font-size: 28px;
      font-weight: normal;
      font-style: italic;
      color: blueviolet;
  }
  
  
  #footer 
  {
      clear: both;
      height: 40px;
      text-align: center;
      background-color: oliveDrab;
      margin 0px;
      padding: 0px;
      color: white;
  }
  
  .special
  {
      font-size: 20px; 
      font-weight: bold;
      font-family: "New Century Schoolbook", Times, sans-serif;
      color: dodgerblue;
  } 
  
  
  p, pre
  {
      padding: 10px 20px;
      margin-left: 50px;
      margin-right: 50px;
      color: darkslateblue;
   }
  </code></pre>