S
S
softshape2018-07-23 14:40:20
css
softshape, 2018-07-23 14:40:20

How to make SVG fill parent div in Firefox?

This SVG was made to completely fill the parent element and be adaptive, that is, change the width when the browser is resized -

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2250 160" preserveAspectRatio="none" 
vector-effect="non-scaling-stroke" style="width: calc(100% - 50px); height: 160px">

With a parent width of 500px, the width of the SVG is 100%-50px = 450px. In all browsers except Firefox.
In Firefox, it stretches normally if, for example , viewBox="0 0 150 160", but it does not want to shrink - with viewBox="0 0 2250 160" its width will be 2200 points, regardless of the width of the browser.
Is it treatable at all?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question