【发布时间】:2017-02-15 21:59:31
【问题描述】:
我试图避免<use class="myicon" xlink:href="myicon" /> 在设置我的 SVG 样式时简单地定位 xlink:href 属性的值。以下选择器似乎都不起作用:
[xlink|href*=myicon], // I also set the namespace at the top of the file
[xlink:href*=myicon],
[xlink\:href*=myicon] {
color: yellow !important;
}
网站上的一些其他问题似乎暗示应该可以在命名空间属性上使用属性选择器进行样式设置,即使纯 html 不支持命名空间属性,因为它应该只将它们视为一个词。但我无法让它发挥作用,所以我对此失去了信心。
【问题讨论】:
标签: html css svg css-selectors xml-namespaces