Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange scrollbars around the svg background in chrome

I have a problem adding an svg file as a background. Everything seems allright, but in Google Chrome I get strage inactive scrollbars on the right and bottom of svg, not a container. Here is screenshot of a problem result: http://xmages.net/show.php/2812560_strangescrollbars-jpg.html

And here comes the part of css

#container>footer {
    width: 1000px;
    margin: -124px auto 0;
    padding-top: 221px;
    background: transparent url("../img/footerBackground.png") no-repeat 42px 0;
}
.backgroundsize.svg  #container>footer {
    background: transparent url("../img/vector/footerBackground.svg") no-repeat 42px 0;
    background-size:  553px 166px;
}

I have no idea where does them come from. Any help?

like image 439
Bardt Avatar asked Dec 16 '22 13:12

Bardt


2 Answers

Look inside the original svg file with any text-editor. If you have any anchor points placed on half pixel, move them to the closest pixel. When you export the SVG, make sure the size of the document is round pixel (ex: 100px), not half pixel (ex 100,49px).

The problem is that if you have a document with half pixel anchor point near the edge of the file, webkit will round it to the closest pixel, and thus think that you have anchor points outside the document, and that will create the fixed scrollbar.

like image 96
louim Avatar answered Dec 19 '22 08:12

louim


In chrome the image seems slightly too big for the container.

Just add

overflow:hidden;

to the container in the CSS, this should stop scrollbars, either that or make the container slightly bigger.

like image 37
Matthew Riches Avatar answered Dec 19 '22 07:12

Matthew Riches