gpt4 book ai didi

html - 模糊 SVG,除非显示为
转载 作者:行者123 更新时间:2023-11-28 05:49:21 25 4
gpt4 key购买 nike

下面是我的 iPhone 5s Safari 的截图:

enter image description here

前两个 SVG 图标显示为 <object> :

<object data="/svg/tabbar/tab_1_active.svg" type="image/svg+xml"></object>

第三 SVG 图标显示为 <img> :

<img src="/svg/tabbar/tab_1_active.svg">

第四 SVG 图标显示为 inline css background :

background: url("data:image/svg+xml,utf8,<svg ...> ... </svg>") //use of base64 does not change anything

问题:问题是,如您所见,除非 SVG 未显示为 <object>它变得模糊。我不知道是什么原因导致模糊。我想将我的 SVG 用作 <img>css bg因为缓存。您对此有什么想法,如何使它不模糊?

在 IE 11 和 Chrome 中没有模糊。

编辑:

tab_1_active.svg 源代码:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="50px" height="50px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 3.8 (29681) - http://www.bohemiancoding.com/sketch -->
<title>Tab Bar/tab_1_active</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M0,23.2992459 C0,24.9534168 1.28523416,25.9045372 2.87260618,25.4230395 L8.39696611,23.7473352 C9.45488626,23.4264362 11.1610036,23.4494105 12.2096711,23.7993121 L17.7903289,25.6613714 C18.8381075,26.0109764 20.5490005,26.0330683 21.6030339,25.7133483 L28.0844661,23.7473352 C29.1423863,23.4264362 30,22.2752576 30,21.1660515 L30,2.70075414 C30,1.04658319 28.7147658,0.0954628257 27.1273938,0.576960458 L21.6030339,2.25266483 C20.5451137,2.5735638 18.8389964,2.55058953 17.7903289,2.2006879 L12.2096711,0.3386286 C11.1618925,-0.0109764369 9.45099951,-0.0330683311 8.39696611,0.286651673 L1.91553389,2.25266483 C0.857613736,2.5735638 0,3.72474244 0,4.8339485 L0,23.2992459 Z" id="path-1"></path>
<mask id="mask-2" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="30" height="25.8782498" fill="white">
<use xlink:href="#path-1"></use>
</mask>
</defs>
<g id="v10" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="StyleGuide" transform="translate(-100.000000, -389.000000)">
<g id="1" transform="translate(100.000000, 389.000000)">
<g id="Tab-Bar/tab_1_active">
<g id="tab_1_active">
<rect id="tab" x="0.857843137" y="0" width="49.0196078" height="50"></rect>
<g id="ic_map" transform="translate(10.000000, 12.000000)">
<use id="Combined-Shape" stroke="#85B1D7" mask="url(#mask-2)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" xlink:href="#path-1"></use>
<rect id="Rectangle-556" fill="#85B1D7" x="8.90625" y="6.5" width="2.8125" height="11.1428571" rx="1.40625"></rect>
<rect id="Rectangle-556-Copy" fill="#85B1D7" x="18.28125" y="8.35714286" width="2.8125" height="11.1428571" rx="1.40625"></rect>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

最佳答案

在移除蒙版并使用 Illustrator 而不是 Sketch 导出后,模糊消失了。

关于html - 模糊 SVG,除非显示为 <object>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37433382/

25 4 0