简体   繁体   English

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

[英]SVG CSS validation error: 'Property fill doesn't exist'

I've created an inline svg, but the css validation comes up with errors (Property fill doesn't exist : #6be300, Property stroke doesn't exist : #1d1d1d, Property stroke-width doesn't exist : 5px.) Any idea what I'm doing wrong? 我创建了一个内联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" /> 

选择“更多选项”,然后在运行验证器时选择一个包含SVG的配置文件。

Solution: 解:

<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" />

Use that fill property and value in inline css and remove in external css. 在内联CSS中使用该fill属性和值,在外部CSS中使用该属性和值。 Solved!!! 解决了!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM