SVG CSS验证错误:'属性填充不存在'

时间:2016-06-15 07:32:42

标签: css svg css-validator

我已经创建了一个内联svg,但是css验证会出现错误(属性填充不存在:#6be300,属性描边不存在:#1d1d1d,属性描边宽度不存在:5px。)知道我做错了什么吗?



 svg {
   height: auto;
   width: 50%;
 }
 rect {
   fill: #6be300;
   stroke: #1d1d1d;
   stroke-width: 5px;
 }

<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 400 400">
  <title>blabla</title>
  <desc>blablabla</desc>

  <rect id="rect1" width="40" height="230" x="20" y="170" rx="10" />
  <rect id="rect2" width="40" height="300" x="60" y="100" rx="10" />
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:4)

选择“更多选项”,然后在运行validator时选择包含SVG的配置文件。

答案 1 :(得分:-4)

解决方案:

<rect id="rect1" fill: #6be300; width="40" height="230" x="20" y="170" rx="10" />
<rect id="rect2" stroke="#1d1d1d" width="40" height="300" x="60" y="100" rx="10" />

在内联css中使用该fill属性和值,并在外部css中删除。解决!!!

相关问题