M
M
MaksimLav2018-10-10 17:26:08
css
MaksimLav, 2018-10-10 17:26:08

How to scale svg like background-size: cover;?

You need to make a selection of areas on the screen by analogy with this site: https://dom-renome.ru/flats/scheme/NOUVEAU/
As I understand it, here an svg is placed on top of the background image, with poligon responsible for a separate floor. When hovering over this polygon, it changes its opacity. The background image has background: 50% 50% no-repeat; background-size: cover;
The problem is, if I try to replicate this technique on my own, my svg scales like it's a background-size: contain; image. There are no problems at FullHD resolution, but with scaling, the svg position does not match the position in the picture
Link to the problem itself: triumf.premium.tmweb.ru/app/alie-parusa-select-con...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bogachev, 2018-10-10
@MaximLav

Try to add preserveAspectRatio="xMidYMid slice"to SVG with these polygons.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question