I
I
Ivan Rivan @Ivan2021-11-03 15:03:51
css
Ivan Rivan @Ivan, 2021-11-03 15:03:51

How to make a non-proportional resizing of an svg image?

I have an image, let's say 100px wide and 50px high.
It is necessary that it stretches in width to the entire width of the browser window, and remains 50px in height and thus stretches with distortion. Didn't the background pave with a repeating image across the width, namely, the image was smeared and stretched with distortion? background-size: 100% 50px; background style does not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
andand44, 2021-11-03
@andand44

background-size: 100% 50px;works
https://jsfiddle.net/ewc7nusf/1/

A
A person from Kazakhstan, 2021-11-03
@LenovoId

Paste this (corrected) svg code to your img and unsubscribe - does it work or not: https://codepen.io/topicstarter/pen/bGraopB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question