Chrome block element has strange border with windows DPI scaling

660 views Asked by At

When testing some styling on different resolutions I have encountered an issue with some block elements on Google Chrome.

http://s3.postimg.org/n89fitzhv/chrome_bug.png

As you can see in the image there appears to be a border rendering between the elements. This is the code used:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <style>
        .test ul li {
            list-style:none;
            display:inline-block;
            width:200px;
            background-color:#1d5b7f;
            float:left;
        }
    </style>
</head>
<body>
    <div id="container">
        <nav class="test">
            <ul>
                <li>test</li>
                <li>test</li>
                <li>test</li>
                <li>test</li>            
            </ul>
        </nav>
    </div>
</body>
</html>

I have found this issue to occur on Google Chrome and Google Chrome Canary when the Windows 7 DPI scaling is not in multiples of 100%. I am using a 3840x2160 resolution monitor. The issue was visible when I changed the resolution down to 1920x1080 also if the scaling was not in multiples of 100%

I have not found this issue to occur on Opera, Safari, Firefox or IE.

I'm tring to find a workaround for this. Does anyone have any ideas or information relating to this. Thanks.

1

There are 1 answers

1
Michaël Chapiro On

Try this style to fix it:

-moz-background-clip: padding-box;
-webkit-background-clip: padding-box;
background-clip: padding-box;