CSS: How to force background images to scale to the container, ignoring aspect ratio
You can scale background images in CSS to the container size using
Commonly, we use
cover because we want to preserve the image's aspect ratio.
If you do not want to do that, simply provide scaling values for X and Y:
background-size: 100% 100%
100% would mean
100% auto and respect the image's aspect ratio)
The above may not work for you when using SVG images. In that case, you must remove the
viewBox attribute from your SVG.
There is no way to do that in CSS, you must edit the file manually (SVGs are just XML) or use some kind of pre-processing.
data: URI. I have not tried that, as it was not relevant for me (and there might be several edge cases).