Results 1 to 5 of 5

Thread: Page width correct in Firefox but not IE... stumped

  1. #1
    Join Date
    May 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Unhappy Page width correct in Firefox but not IE... stumped

    Hello all,

    Usually CSS is pretty easy for me, but I just jumped into a project and have no idea what the first group did. Right now the page appears correctly in Firefox (3.6.4) but when I test it in IE6 it doesn't show the main content width correctly. We don't have any higher IE than 6 so I haven't check it on those browsers. I've finally admitted defeat and maybe someone can worm through their CSS and catch something I missed.

    The page is: http://www.deaconess.com/defaultNEW5.cfm.
    CSS file: http://www.deaconess.com/css/default1.css

    If anyone could shed some light on this I would really appreciate it. I believe it has something to do with the margins or padding because the difference is roughly 30px between the two browsers.

    thanks for taking a look!
    rsollman
    Last edited by rsollman; 07-06-2010 at 02:13 PM.

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    This is a known bug in IE 6 and it may also be present in IE 7. You can google the: IE 6 box model. It is not easy to fix within the regular css so often the solution will be to make separate stylesheets for those browsers. Something like this can be used
    Code:
    <!--[if lt IE 8]>
    	<link rel="stylesheet" type="text/css" href="ie7-and-down.css" />
    <![endif]-->
    it is placed beneath the link to the regular css and you then make a new stylesheet called " ie7-and-down.css" ( in this example), and here you can target and override the specific problems, usually width. The conditional stylesheet in this example will be read by all IE browsers of a version lesser than IE8. Here is a link explaining how to target different IE versions. Of course there are others ways it can be done but this might be the easiest in your case. To see the page in other browser versions you can use browsershots.org, allthough its a bit slow. Another posibillity is adobe browserlab

  3. #3
    Join Date
    May 2010
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    You should really try to use a simpler, non-table based method for centering the layout. This will make things work a lot more consistently across the various browsers. here is basic framework of the method I use:

    Code:
    body {
       text-align: center;
      }
    
    .pagewrap {
      text-align: left;
       width: 960px;
       margin: 0 auto;
      }
    
    <body>
      <div class="pagewrap">
          Everything goes in here
      </div><!-- /pagewrap -->
    </body>

  4. The Following User Says Thank You to zip222 For This Useful Post:

    rsollman (07-06-2010)

  5. #4
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    I agree, and using a Meyer css reset is also very helpful. But the IE bugs are stubborn so you might end up having to use the conditional stylesheets nevertheless.

  6. The Following User Says Thank You to azoomer For This Useful Post:

    rsollman (07-06-2010)

  7. #5
    Join Date
    May 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Thumbs up non-table layout

    Quote Originally Posted by zip222 View Post
    You should really try to use a simpler, non-table based method for centering the layout. This will make things work a lot more consistently across the various browsers. here is basic framework of the method I use:
    I agree completely and non-table layouts is how I was taught, but the main project manager overseeing the redesign wants tables. Stuck in the old system and it's been extremely difficult to be allowed even styling divs and classes.

    I've found the bug and it involved a change with width and margins/padding. Don't know exactly what fixed it because there were 3 people editing all at the same time.

    Thanks for all of your help.

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
  •