SVG在浏览器中可以使用,但在Illustrator或InkScape中会损坏(仅显示一个黑框) [英] SVG fine in browsers but broken (just shows a black box) in Illustrator or InkScape

查看:193
本文介绍了SVG在浏览器中可以使用,但在Illustrator或InkScape中会损坏(仅显示一个黑框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了由程序生成的SVG文件的问题.它们可以很好地验证,可以在浏览器和OS X Preview中正常显示,但是在Illustrator或InkScape或其他各种程序中却显示为大黑框.

I've got an issue with SVG files generated by a program. They validate fine, display fine in browsers and in OS X Preview, but display as a big black box in Illustrator or InkScape or various other programs.

我怀疑这与透明度或标签不受支持等有关,但我真的不知道是什么-粗略地看一眼就可以了...

I suspect there's something to do with transparency or a tag not being supported or something, but I don't really know what - and a cursory glance looks fine...

有数百种.我可以编写一个脚本来更正所有这些,但是我不知道要纠正什么...!

There are hundreds of these. I can write a script to correct them all but I don't know what to correct...!

原始SVG

在Illustrator或InkScape中的外观

最大

推荐答案

并非所有人都支持使用rgb a 语法进行填充.尝试使用rgb值,例如rgb(255, 255, 255),十六进制颜色,例如#ffffff或命名的颜色,例如white.

Using an rgba syntax for fill is not supported everywhere. Try using rgb values e.g. rgb(255, 255, 255), hex colours e.g. #ffffff or named colours e.g. white.

无论如何您都不需要a,因为您的不透明度始终为1,如果您这样做,则指定一个单独的填充不透明度值会更方便.

You don't need the a anyway as your opacities are always 1 and if you did it would be more portable to specify a separate fill-opacity value.

这篇关于SVG在浏览器中可以使用,但在Illustrator或InkScape中会损坏(仅显示一个黑框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆