我想转发这段代码
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 44.2 42.7" enable-background="new 0 0 44.2 42.7" xml:space="preserve">
<g>
<g>
<path fill="#FFFFFF" d="M20.1,20.7c0.5-0.2,0.9-0.4,1.2-0.7c0.6-0.6,0.9-1.3,0.9-2.1c0-1.1-0.3-1.9-1-2.5c-0.7-0.7-1.6-1-2.6-1
h-6.3v13.6h6.3c1.3,0,2.2-0.3,2.9-1c0.8-0.8,1.2-1.8,1.2-2.9c0-1-0.3-1.7-1-2.4C21.3,21.2,20.8,20.9,20.1,20.7z M14.1,15.8h4.4
c0.5,0,0.9,0.2,1.2,0.5c0.4,0.4,0.6,0.9,0.6,1.5c0,0.7-0.2,1.2-0.6,1.7c-0.4,0.4-0.8,0.6-1.3,0.6h-4.3V15.8z M20,25.7
c-0.4,0.4-1,0.6-1.8,0.6h-4v-4.8h4c0.8,0,1.4,0.2,1.9,0.7c0.4,0.4,0.6,1,0.6,1.7C20.7,24.7,20.4,25.2,20,25.7z"/>
<path fill="#FFFFFF" d="M30.7,26.1c-0.3,0.3-0.8,0.5-1.6,0.5c-0.7,0-1.3-0.2-1.8-0.7c-0.5-0.5-0.8-1.3-0.8-2.5H33
c0-1.5-0.4-2.7-1.1-3.4c-0.8-0.8-1.7-1.2-2.9-1.2c-1.2,0-2.1,0.4-2.9,1.1c-0.9,0.9-1.3,2.1-1.3,3.5s0.4,2.6,1.3,3.4
c0.8,0.8,1.8,1.2,3.1,1.2c1.2,0,2.2-0.3,2.9-1c0.5-0.5,0.8-1.2,1-2.1h-1.7C31.3,25.3,31.1,25.7,30.7,26.1z M27.3,20.8
c0.4-0.4,1-0.6,1.6-0.6c0.7,0,1.2,0.2,1.6,0.6c0.4,0.4,0.6,0.9,0.6,1.4h-4.5C26.7,21.6,27,21.2,27.3,20.8z"/>
<path fill="#FFFFFF" d="M30.5,20.7c-0.4-0.4-0.9-0.6-1.6-0.6c-0.6,0-1.2,0.2-1.6,0.6c-0.4,0.4-0.6,0.8-0.7,1.3h4.5
C31.1,21.6,30.9,21.1,30.5,20.7z"/>
<path fill="#FFFFFF" d="M19.7,19.4c0.4-0.4,0.6-1,0.6-1.7c0-0.6-0.2-1.1-0.6-1.5c-0.3-0.3-0.7-0.5-1.2-0.5h-4.4V20h4.3
C18.9,20,19.3,19.8,19.7,19.4z"/>
<path fill="#FFFFFF" d="M18.1,21.5h-4v4.8h4c0.8,0,1.4-0.2,1.8-0.6c0.5-0.5,0.7-1.1,0.7-1.7c0-0.7-0.2-1.3-0.6-1.7
C19.6,21.7,18.9,21.5,18.1,21.5z"/>
<path fill="#FFFFFF" d="M22.1,3C12,3,3.9,11.2,3.9,21.3c0,10.1,8.2,18.3,18.3,18.3s18.2-8.2,18.2-18.3C40.4,11.2,32.2,3,22.1,3z
M25.5,17.2H32v0.7h-6.5V17.2z M21.4,26.9c-0.6,0.6-1.6,1-2.9,1h-6.3V14.3h6.3c1.1,0,1.9,0.3,2.6,1c0.6,0.6,1,1.5,1,2.5
c0,0.8-0.3,1.6-0.9,2.1c-0.3,0.3-0.7,0.6-1.2,0.7c0.6,0.2,1.1,0.5,1.5,0.9c0.6,0.6,1,1.4,1,2.4C22.6,25.1,22.2,26.1,21.4,26.9z
M32,27c-0.7,0.7-1.6,1-2.9,1c-1.3,0-2.3-0.4-3.1-1.2c-0.8-0.8-1.3-2-1.3-3.4s0.4-2.6,1.3-3.5c0.7-0.7,1.7-1.1,2.9-1.1
c1.1,0,2.1,0.4,2.9,1.2c0.7,0.7,1.1,1.9,1.1,3.4h-6.4c0,1.1,0.3,1.9,0.8,2.5c0.5,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I2LTAuMjI4LTAuNTU0LTAuNDE5LTAuODcyLTAuNTY0Yy0wLjQ0Ni0wLjIwMy0wLjk0MS0wLjMxNy0xLjQ2My0wLjMxN2MtMC41MjEsMC0xLjAxNywwLjExNC0xLjQ2MywwLjMxNw0KCWMtMC4zMTksMC4xNDUtMC42MTIsMC4zMzYtMC44NzMsMC41NjRjLTAuNzQyLDAuNjUtMS4yMTEsMS42MDQtMS4yMTEsMi42NjZDMjUyLjY3NCwyNTguMDM4LDI1NC4yNjYsMjU5LjYyOSwyNTYuMjIxLDI1OS42Mjl6DQoJIE0yNjUuMjMsMjUwLjUxNWMwLTEuOTY1LTEuNTk0LTMuNTU5LTMuNTYtMy41NTloLTkuNzI1djQuNDg3aC0wLjcyOXYtNC40ODdoLTAuNDIxYy0wLjAyOCwwLTAuMDU1LDAuMDAxLTAuMDgzLDAuMDAydjQuNDg1aC0wLjcyOQ0KCXYtNC4zOTNjLTAuMTc3LDAuMDQxLTAuMzQ5LDAuMDk1LTAuNTE0LDAuMTYydjQuMjNoLTAuNzI5di0zLjgzM2MtMC45MDksMC42NDUtMS41MDMsMS43MDUtMS41MDMsMi45MDR2Mi4zMzdoNS43MDUNCgljMC44MzUtMC44NDgsMS45OTYtMS4zNzQsMy4yOC0xLjM3NGMxLjI4NCwwLDIuNDQ1LDAuNTI2LDMuMjgsMS4zNzRoNS43MjlMMjY1LjIzLDI1MC41MTVMMjY1LjIzLDI1MC41MTV6Ii8+DQo8L3N2Zz4NCg==")
}
谢谢
答案 0 :(得分:1)
您可以通过以下几种方式获取数据网址。一种方法是使用如下的在线工具:
http://www.mobilefish.com/services/base64/base64.php
但就个人而言,我的偏好是将SVG保存在像Illustrator这样的应用程序中。我将其保存为.svg文件。然后将它放入像这样的图像元素中:
<img src="/i/logo.svg" alt="logo">
如果您打开Chrome中显示该图片的页面,请右键单击图像并检查元素。在检查器中,右键单击图像URL,然后在“资源”面板中选择“打开链接”。在资源面板中,右键单击图像,然后选择“将图像复制为数据URL”。
看起来像是一项冗长的任务,但我发现这是最可靠的方式。