Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在内联 SVG 中有一个链接的图像,SVG 删除了高度和宽度值。当尺寸选项设置为百分比时,图像似乎消失了,所以我将它们保持在 px 值,这就是 SVG 似乎保持的高度。
此链接将演示我想要更轻松地实现的目标:示例
基本上我希望 SVG 表现得像它上面的图像一样,但是链接的图像是从它的 SVG 容器的中心而不是顶部缩放的。
谢谢,
-n
看起来你所要做的就是添加
svg { max-height:100%; }
到你的 CSS。
这是一个 webkit 错误。看
使用宽度 = 100 和高度 = 100 的 svg 我在 safari e chrome 中获得了额外的空间
一些可能的解决方案。