SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Apr 2003
    Location
    canada
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Page will center in Firefox but not IE

    Hi,

    I must be brain dead today as I'm missing something quite simple I'm sure.

    I'm working on a development site for a photographer and I can have the page center in Firefox but not IE link is at www.clhdesigns.com/photosense/index.html

    here is the CSS code to go with it. I even have the page reset syntax at the very top of the css file

    Code:
    * {
    	margin: 0;
    	padding: 0;
    }
    
    
    body {
    	background: #333333;
    	text-align: left;
    	font: 62.5% Arial, Verdana, Helvetica, sans-serif;
    	background: #554629 url(images/bg.png) repeat-x;/*this is the bg colour*/
    }
    
    p {
    	margin:10px 0;
    	color:#fff;
    	font-size:1.3em;
    }
    
    h1 {
    	color:#d7ba6c;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size:2.2em;
    }
    
    h2 {
    	color:#d7ba6c;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:1.6em;
    }
    
    .imgright {
    	float:right;
    	margin: 15px 20px 10px 50px;
    }
    
    #container {
    	width: 920px;
    	margin: 0px auto;
    	text-align: left;
    	background:#333333;
    	border:#FFFFFF 1px solid;
    }
    
    #header {
    	margin:0;
    	height:88px;
    	width:920px;
    	background-image:url(images/header.gif);
    }
    #nav {
    	background-color:#F0E5BC;
    	color: #000000;
    	border-top: 1px solid #000000;
    	font: 1.4em "Trebuchet MS",sans-serif;
    }
    
    #nav ul {
    	list-style-type: none;
    	padding: 10px 34px;
    }
    #nav li {
    	display: inline;
    	padding: 0 10px;
    }
    #nav a {
    	color: #000000;
    	text-decoration: none;
    }
    #nav a:visited {color: #000000;}
    #nav a:hover {color: #654235; background: #eee;}
    
    #content {
    	float:left;
    	padding: 20px 40px;
    	background: #333333;
    	border:1px solid #ffffff;
    }
    As usual I know I'm missing something so very simple I will be ashamed of myself lol

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Set width:920px;margin:0 auto; on #container not #wrapper.

    But seeing as #container does absoltuely nothing helpful for you just delete <div id="container"> and the </div> to go along with it.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have a commented out old doctype before the actual page doctype, which drops IE into quirks mode, preventing the centring - get rid of the comment at the top of the page.

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    *Wow*

    I missed that. For IE6+ to be able to understand margin:0 auto you need to be not in quirks mode. For IE5.5- you need to set text-align:center; on the outmost parent element and set text-align:left; for the inner child. (Just in case you are cratering for some IE5.5 users)
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  5. #5
    SitePoint Addict
    Join Date
    Apr 2003
    Location
    canada
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, as I said i knew I was being braindead in this one.

    problem solved.
    Your Websites Your Way!!
    www.clhdesigns.com

  6. #6
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Your welcome . If you have any more questions just come back.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •