Answer the question
In order to leave comments, you need to log in
Why is svg path truncated/not scaled?
There is a div block with certain dimensions. Inside it is an svg element with path. The svg element is given css to scale to fit:
svg {
height: 100%;
width: auto;
max-width: 100%;
max-height: 100%;
object-fit: cover;
overflow: hidden;
vertical-align: middle;
}
preserveAspectRatio="xMinYMin meet"
viewBox="0px 0px 300px 200px"
Answer the question
In order to leave comments, you need to log in
The viewport does not specify a unit of measure. Just write
preserveAspectRatio="xMinYMin meet"
viewBox="0 0 300 200"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question