【发布时间】:2015-09-26 01:53:58
【问题描述】:
我正在使用 D3.js 将文本元素附加到 SVG 组元素,如下所示:
d3.select('#legend').append('text')
.attr('x', 10)
.attr('class', 'remove-country')
.attr('y', 10)
.attr('font-size', '15px')
.attr('font-weight', 'bold')
.attr('fill', '#555')
.style('cursor', 'pointer')
.html('☓')
这里,“#legend”是一个组元素。 ☓ 是用于在 html 中打印十字符号的 unicode。参考:
http://www.w3schools.com/charsets/ref_utf_misc_symbols.asp
问题是这个十字符号在 Chrome 上渲染得很好,但在 Safari 上似乎不起作用。有什么不同的方式可以显示十字符号吗?
【问题讨论】:
标签: javascript d3.js svg unicode safari