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 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Banner shifted 1px in Chrome in presence of scrollbar

    Hello,

    I am developing a website, and I have a disturbing little rendering issue in Google Chrome. On a page where I have inserted a bit of content, my banner is shifted 1px to the left, extending outside of the wrapper to the left, and leaving a white space between itself and the right-hand edge of the wrapper. On other pages of the same site to which I have not yet added much content, this does not happen.

    The issue seems to stem from the fact that the page with lots of content now requires a vertical scrollbar (at least on my screen: 1366x768). The other pages do not yet need a scrollbar, but they will, which means this problem will be widespread in Chrome if I cannot resolve it. Firefox does not exhibit this problem, and the banner remains snug within the boundaries of the wrapper.

    Any help with this would be appreciated.

    Screenshots:

    Right side of page banner without a scrollbar:



    Right side of page banner with a scrollbar:



    HTML for the page with need for a scrollbar:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
     <title>Tropical Tidbits - Analysis Tools</title>
     <meta name="description" content="Tropical Tidbits - tropical weather and Atlantic hurricane information, analysis, and forecasts" />
     <meta name="keywords" content="tropical,tidbit,tidbits,atlantic,hurricane,weather,storm,Levi,Cowan,Levi Cowan,analysis,information,forecast,cyclone,ocean,caribbean,united states,tracking,models,news,depression,honduras,nicaragua,jamaica,cuba,puerto rico,florida,gulf of mexico,radar,satellite,surface,data,loops,maps,current,invest,africa,rain,wind,flooding,storm surge,meteorology,official" />
     <meta name="author" content="Levi Cowan" />
     <link rel="stylesheet" type="text/css" href="common-styles.css" />
     <style>
     #title {
     color: #860000;
     font-size: 1.6em;
     }
    
     p { width: 800px; }
    
     table { border-spacing: 20px 0; }
    
     table, tr, td { margin: 0; padding: 0; }
    
     tr { height: 180px; }
    
     td { width: 300px; }
    
     td, #satellite a:hover, #radar a:hover, #surface a:hover, #models a:hover, #ocean a:hover, #upper a:hover {
     border-radius: 12px;
     -moz-border-radius: 12px; /*Support for older browsers*/
     -webkit-border-radius: 12px;
     }
    
     td a { 
     display: block; 
     height: 180px;
     }
     
     #satellite { background: url('images/satellite.png') 0 -180px; }
    
     #satellite a:hover { 
     background: url('images/satellite.png') 0 0;
     }
     
     #radar { background: url('images/radar.png') 0 -180px; }
    
     #radar a:hover { 
     background: url('images/radar.png') 0 0; 
     }
    
     #surface { background: url('images/surface.png') 0 -180px; }
    
     #surface a:hover { 
     background: url('images/surface.png') 0 0; 
     }
    
     #models { background: url('images/models.png') 0 -180px; }
    
     #models a:hover { 
     background: url('images/models.png') 0 0;
     }
     
     #ocean { background: url('images/ocean.png') 0 -180px; }
    
     #ocean a:hover { 
     background: url('images/ocean.png') 0 0; 
     }
    
     #upper { background: url('images/upper.png') 0 -180px; }
    
     #upper a:hover { 
     background: url('images/upper.png') 0 0; 
     }
     
     </style>
    </head>
    <body>
    <div id="wrapper">
     <div id="banner">
      <ul id="navbar">
      <li><a href="index.html">Home</a></li>
      <li><a href="storminfo.html">Current Storm Info</a></li>
      <li><a href="invest-tracking.html">Invest Tracking</a></li>
      <li id="current-page"><a href="analysis.html">Analysis Tools</a></li>
      <li><a href="links.html">Links Database</a></li>
      </ul>
     </div> <!-- end banner -->
     <div id="main-section">
     <span id="title">Tropical Weather Analysis Tools</span>
     <p>There are many different scientific tools that are at our disposal for analyzing hurricanes and tropical weather, helping to improve forecasts. Here are some of them for your use. Descriptions of these data types are found farther down the page.</p><br>
     <table>
      <tr>
      <td id="satellite">
       <a href="satellite.html"></a>
      </td>
      <td id="radar">
       <a href="radar.html"></a>
      </td>
      <td id="surface">
       <a href="surface.html"></a>
      </td>
      </tr>
     </table>
     <br>
     <table>
      <tr>
      <td id="models">
       <a href="models.html"></a>
      </td>
      <td id="ocean">
       <a href="ocean.html"></a>
      </td>
      <td id="upper">
       <a href="upper.html"></a>
      </td>
      </tr>
      </table>
     </div>
    </div> <!-- end wrapper -->
    </body>
    </html>
    And here's the common CSS to all pages, which includes the styling of the banner:

    Code:
    body { 
     font-family: arial, sans, sans-serif;
     font-size: 100%;
     margin: 0;
     padding: 0;
     overflow-x: hidden;
     background-image: url('images/wrapper-dropshadow.jpg');
     background-position: center;
     background-repeat: repeat-y;
     }
    
     #wrapper {
     width: 1024px;
     margin: 0 auto;
     }
    
     #banner { 
     background-image: url('images/banner.jpg');
     width: 1024px;
     height: 169px;
     }
    
     #navbar {
     list-style-type: none;
     margin: 0;
     padding: 0;
     position: relative; left: 200px; top: 110px;
     }
    
     #navbar li { 
     float: left;
     margin-left: 5px;
     background: rgb(0,106,205); /*Fallback for IE 8 and older*/
     background-color: rgba(0,106,205,0.35);
     border-radius: 12px;
     -moz-border-radius: 12px; /*Support for older browsers*/
     -webkit-border-radius: 12px;
     }
    
     #navbar a {
     display: block;
     padding: 13px 15px;
     color: #FFF;
     font-size: 1.2em;
     }
    
     #navbar a:link { text-decoration: none }
    
     #navbar a:hover { 
     background: rgb(0,16,97); /*Fallback for IE 8 and older*/
     background-color: rgba(0,16,97,0.35);
     border-radius:12px;
     -moz-border-radius: 12px; /*Support for older browsers*/
     -webkit-border-radius: 12px;
     }
    
     #navbar #current-page {
     background: rgb(0,16,97); /*Fallback for IE 8 and older*/
     background-color: rgba(0,16,97,0.35);
     }
     /* -----End Styling of Banner and Navigation----- */
    
     #main-section {
     font-size: 0.8em; 
     padding: 20px; 
     }

  • #2
    New Coder
    Join Date
    Aug 2011
    Location
    Fuquay Varina NC
    Posts
    21
    Thanks
    1
    Thanked 2 Times in 2 Posts
    yes, check the margin and padding... should be 0

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by FuquayDentist View Post
    yes, check the margin and padding... should be 0
    Of what? The banner? That's not even the issue, and I tried it anyway, but no effect. The element is moving outside of its div. That's not a margin issue.

  • #4
    New Coder
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have found a post that details the same issue that I have. Apparently it has to do with odd-numbered pixel widths for the browser viewport when there is a vertical scrollbar. I have tested and seen that randomly resizing my browser window to even pixel widths will fix the problem, but for default maximized viewport widths of odd numbers, the problem exists. I can't think of a way to fix this without messing up the rendering for even-numbered viewport widths. For example, a 1px shift wouldn't work. Any suggestions?

    http://www.sohtanaka.com/web-design/...alignment-bug/

  • #5
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    are you talking about the 1px of white space near the scrollbar to the right?

    upload a live copy either to a server (there are free ones online if you dont have one yet). You can also just google 1px chrome bug.


  •  

    Tags for this Thread

    Posting Permissions

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