Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

1 pixel of background repeat during zoom in Google Chrome

I have faced really strange problem in google chrome (desktop and mobile). Here is jsfiddle example. If you zoom in till 500% you ll see green line at the top of the div. It seems that background image repeats itself. The green line is the bottom line of my background image, if I make background image bottom transparent the line it disappears. I added repeat-x in my css but it still repeats 1 pixel of my image:

background: url('') repeat-x;
like image 647
Andrew Avatar asked Jun 13 '13 13:06

Andrew


People also ask

How do I stop chrome from zooming?

Navigate to the URL chrome://flags/#enable-pinch in your browser and disable the feature. The pinch zoom feature is currently experimental but turned on by default which probably means it will be force-enabled in future versions.

Why is my Google font so small on Android?

To make your font size smaller or larger: On your device, open the Settings app. Search and select Font size. To change your preferred font size, move the slider left or right.


1 Answers

Subtract 1px from everything, including the background x-position.

.red-div{
    background-color: red;
    height: 29px;
    width: 300px;
}

.child {
    width: 100%;
    height: 100%;
    background: url('') repeat-x;
    background-position:-1px 100%;

}

JSFiddle

like image 136
Cattsan Avatar answered Oct 13 '22 23:10

Cattsan