How do I scale a linked image inside an SVG from t

2019-06-05 17:51发布

I have an image linked in an inline SVG, the SVG has the height and width values removed. The image seems to disappear when dimension options are set to percent so I've kept them at px value, which is what the SVG seems to be keep as its height.

This link will demonstrate what I'm trying to achieve much easier: example

Basically I want the SVG to behave as the image above it does, but the linked image is scaling from the center of its SVG container and not the top.

Thanks,

-n

2条回答
The star\"
2楼-- · 2019-06-05 18:19

Looks like all you have to do is add

svg {
  max-height:100%;
}

to your CSS.

查看更多
爷、活的狠高调
3楼-- · 2019-06-05 18:34
登录 后发表回答