Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Big background - 1px problem

    Hi,

    I'm loosing my head with one problem. I've got this design:

    http://dnawrot.proste.pl/posejdon/

    The problem is that main content div is shifted 1px to the left in Opera, while in FF everything looks fine. I've been strugling with that problem couple of hours, and I have no explanation about it. The problem also appears in IE but only then I change the size of the window. In maximize browser it looks fine (except Opera). I've checked it with any available developer tool.

    The difference is:

    OPERA SCREENSHOT MEASURE


    FF SCREENSHOT MEASURE


    Can anybody help me please?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,666
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    Have you tried resizing the browser window in Firefox and Opera, too? You may notice a 1px shift for every other pixel of resizing. This is probably a rounding issue with your images/content width. If you resize the window by two pixels the browser has to shift the content by one pixel to keep it in place. Now different browsers decide differently when to move it. Some browsers move it with the first pixel of resizing, some move it with the second pixel. And some browsers even move different content differently, relative to the place that content is positioned in. So, you should play with the containers that contain the images and rearrange things as necessary.

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello gooddhost,
    I gave your text div an id and removed the inline styles like this -
    Code:
    			<div class="main_content_header"></div>
    		
    				<div id="text">
    				<h1>Informacje o nas</h1><br>
    				Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam condimentum tempor diam. In hac habitasse platea dictumst.
    And then changed a few things in your CSS like this
    Code:
    *  {
    padding: 0;
    margin: 0;
    border: none;
    }
    
    body{
    font-family: Tahoma, Arial, Verdana, sans-serif;
    font-size: 11px;
    color: #83b4d4;
    background: #064272 url('img/header.jpg') no-repeat center top;
    width: 100%;
    }
    
    #container {
    }
    
    #inner_container {
    width: 913px;
    margin: 0 auto; 
    padding: 0 0 0 37px;
     /*background: #ccc;for testing*/
    overflow: auto; /*to clear the floats*/
    }
    
    #header {
    padding:0 0 0px;
    height: 262px;
    }
    
    #logo {
    position: relative;
    top: 10px;
    left: 20px;
    width: 204px;
    height: 46px;
    }
    
    #my_navigation {
    position: relative;
    top: -30px;
    left: 300px;
    width: 500px;
    }
    
    #my_navigation ul {
    
    list-style-type: none;
    
    }
    
    #my_navigation li {
    float: left;
    list-style-type: none;
    margin: 0 10px 0 0;
    }
    
    #my_content {
    width: 672px;
    text-align: justify;
    min-height: 500px;
    }
    
    #my_content h1 {
    font-family: "Trebuchet MS", Verdana, Tahoma, Arial, sans-serif;
    color: #fff;
    font-size: 25px;
    font-weight: normal;
    }
    
    #text {
    margin: -81px 0 0; 
    padding: 0pt 20px; 
    line-height: 18px; 
    width: 632px;
    }
    
    #realtive_bg {
    position: relative;
    top: 81px;
    }
    
    #cont {
    margin: 0px 0 0 0;
    }
    
    #main_content {
    width: 672px;
    background: url('img/content_bg.jpg') repeat-y;
    }
    
    .main_content_header {
    background: url('img/content_header.jpg') no-repeat top left;
    width: 672px;
    height: 81px;
    }
    
    .main_content_footer {
    background: url('img/content_footer.gif') no-repeat top left;
    width: 672px;
    height: 6px;
    }
    
    #my_breadcrumb {
    padding:0 0 0px 0px;
    margin:0 0 30px 30px;
    }
    
    #my_breadcrumb a {
    color: #8cafc7;
    }
    
    #my_sidebar_left {
    float: left;
    padding: 100px 0 0 9px;
    width: 219px;
    }
    
    #my_sidebar_left .inner {
    background: url('img/aktualnosci_bg.gif') repeat-y top left;
    }
    
    #footer {
    clear: both;
    background: #064272 url('img/footer.png') no-repeat center top;
    height: 169px;
    margin: auto;
    }
    It's working in FF3, it resizes without showing your 1px jog now. Too many changes made to point out - I usually highlight them in red but...
    You'll just have to compare the original CSS to the new to see it. The margin:0 0 0 37px; in #inner_container was the final cure but some other things had to be changed before that would work.

    Read about clearing your floats here. Very important!

    ...
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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