Questions tagged «svg»



3
将Schema.org徽标标记与SVG图像一起使用
我制作了一个很棒的徽标,并将其保存为AI和SVG格式。我希望在网站上使用SVG文件,因为徽标会在网站上出现很多次,并且比以PNG格式保存徽标和有不必要的服务器端请求要好。现在,使用以下命令效果很好: <svg id="my-logo" height="60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <g transform="scale(0.1)"> <image x="0" y="0" height="600" width="600" xlink:href="my-logo.svg" /> </g> </svg> 现在,使用Schema.org logo标记时会出现问题。使用: <svg itemscope itemtype="http://schema.org/Organization" id="my-logo" height="60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <g transform="scale(0.1)"> <image itemprop="logo" x="0" y="0" height="600" width="600" xlink:href="my-logo.svg" /> </g> </svg> 如我所料,它未通过W3C验证,并且收到以下错误消息: 此时,元素svg上的属性itemscope不允许。 此时,元素svg上不允许使用属性itemtype。 此时,元素image上的属性itemprop不允许使用。 现在,我知道W3C验证不是必不可少的事情,但是我更希望有一个能够同时满足Google和W3C要求的解决方案。 我确信某些W3C专家将能够向我指出正确的方向,如果可能的话,我建议不要使用DATA URI,因为我知道这可能是一种解决方案,但是如果我错了或者不是DATA URI的话,请更正我不可缓存。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.