473,799 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1477
JKing
1,206 Recognized Expert Top Contributor
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
2120
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 light on. 1) I've attempted to create an empty box with an inset border and a width of 782px. What I've noticed is that in IE 6 the border does not change the size of the box. However, I've noticed that in Netscape 7.02, the border actually...
6
1321
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 = wc.UploadData("http://www.website.com/login?service2&user=joebloggs&blah","P OST", new byte{}); wcResponse =
27
2353
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 there a workaround for this? Thanks
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.