SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2006
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1px left shift IE fix?

    Read that IE can sometimes have a 1px rounding error shifting centered backgrounds 1 pixel to the left? Is there a fix for this?

    What would one have to fix in below code to also make it work in IE (it works in FF)? The background image is 1000 px wide.

    Code:
    <style>
    
    * {
    margin:0px;
    padding:0px;
    }
    body {
    background:url(backgroundimage.jpg);
    background-repeat:repeat-y;
    background-position:center;
    margin:0px;
    }
    #c {
    width:800px;
    height:auto;
    margin:0px auto;
    background:#0000CC;
    overflow:hidden;
    float:none;
    }
    
    </style>

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try background: center center; instead of just center;

    And if you're not floating something, there's no need to use float: none; unless Opera is refusing to clear a float the old fashioned way.

  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)
    Quite annoying when someone posts the same question on different forum boards at the same time.......

    This is addressed in Paul's "CSS FAQ" sticky thread at the top of the css forum here, and is basically as I answered on the other board......


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
  •