473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Why is website wrapper is not aligning with auto margins in any browser?

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.

Expand|Select|Wrap|Line Numbers
  1.  
  2. body {
  3.     font-family: "Times New Roman", Times, serif;
  4.     font-size: 1em;
  5.     text-align:center;
  6. }
  7.  
  8.  
  9. h1 { 
  10.     font: bold 2em Lucida Console, Times, serif; 
  11. }
  12. h2 { 
  13.     font: bold 1.5em "Times New Roman", Times, serif; 
  14. }
  15. h3 { 
  16.     font: bold 1.2em Arial, Geneva, Helvetica, sans-serif; 
  17. }
  18.  
  19.  
  20. }
  21. #wrapper {
  22.     text-align:left;
  23.     width: 900px;
  24.     margin-left: auto;
  25.     margin-right: auto;
  26. }
  27.  
  28. #mainhead {
  29.     text-align: center;
  30.     width: 900px;
  31. }
  32.  
  33.  
  34. #navi {
  35.     float: left;
  36.     width: 148px;
  37.     margin-top:10px;
  38.     margin-bottom: 10px;
  39.  
  40. }
  41.  
  42. .navibox {
  43.  
  44.     width:148px;    
  45.     height: 25px;
  46.     background-image:url(naviboximg.jpg);
  47.     margin-bottom: 2px;
  48. }
  49.  
  50. #content {
  51.     float: left;
  52.     width: 718px;
  53.     margin-top: 10px;
  54.     margin-bottom: 10px;
  55.     margin-left: 10px;
  56.     padding: 10px;
  57.  
  58. }
  59.  
  60. #footer {
  61.     text-align: center;
  62.     /*clear: both;*/
  63.     width: 898px;
  64. }
  65.  
  66. a:link {
  67.     color :#FEF47E;
  68. }
  69.  
  70. a:visited {
  71.     color: #FEF47E;
  72. }
  73.  
  74. a:hover {
  75.     color: #FEF47E;
  76. }
  77.  
  78. a:active {
  79.     color: #FEF47E;
  80. }
  81.  
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <link href="cssstyle.css" rel="stylesheet" type="text/css" />
  4.  
  5.     <head>
  6.     </head>
  7. <body>
  8.  
  9.     <div id="wrapper">
  10.  
  11.         <div id="mainhead">
  12.  
  13.             <h1>Title</h1>
  14.             <h2>sub-heading</h2>
  15.  
  16.         </div>
  17.  
  18.         <div id="navi">
  19.             <div class="navibox">
  20.             </div>
  21.             <div class="navibox">
  22.             </div>
  23.             <div class="navibox">
  24.             </div>
  25.             <div class="navibox">
  26.             </div>
  27.         </div>
  28.  
  29.         <div id="content">
  30.             <br />
  31.             <p> blah blah blah </p>
  32.             <br />
  33.         </div>
  34.  
  35.         <div id="footer">
  36.             <p> blah blah </p>
  37.         </div>
  38.  
  39.  
  40.  
  41.  
  42.     </div>
  43.  
  44. </body>
  45.  
  46. </html>
  47.  
Nov 11 '10 #1
1 1463
JKing
1,206 Expert 1GB
Line #20 in your CSS you have an extra }.

You should be declaring a doctype in your html as well. Other than that everything looks okay to me.
Nov 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bryan R. Meyer | last post by:
Hello Everyone, I've been working with CSS trying to understand it and incorporate it into a revised version of my web page. I've noticed a few problems which perhaps someone could shed some...
6
by: Alan | last post by:
Hi All, I am trying to make a few calls in succession to a website to allow me to login and then perform a search, in a c# windows program. wcResponse =...
27
by: Harris Kosmidhs | last post by:
Hello. sorry if this has been answered previously. I use a main wrapper div to put the whole site in it. And I use margin: 0 auto 0 auto in order to center the page. But in IE it fails. Is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.