【发布时间】:2014-07-14 01:25:37
【问题描述】:
如何使用 javascript 设置 svg 文本元素的 glyph-orientation-horizontal 属性?
我试过了
svg.setAttribute("style","glyph-orientation-horizontal:90");
也试过
svg.style.glyph-orientation-horizontal=90;
第一个清除所有样式值,以便 style='' 第二个抛出 javascript 错误
svg 定义为
var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
我是否需要单独设置容器 svg 的所有子文本元素的值?或者我可以在容器 svg 上设置值并且文本元素将继承该值?
任何建议将不胜感激。
谢谢, 克里斯托弗
【问题讨论】:
标签: javascript html css text svg