开发者

how to set font-size font-family

i have code like this but its not working

var t = r.text(100,开发者_运维技巧 100, 'test');
t.attr({font-size: 16});

giving me error

missing : after property id

here is documentation for raphael.js http://raphaeljs.com/reference.html


For attributes with a hyphen in the name, you need to use a string literal.

var t = r.text(100, 100, 'test');
t.attr({ "font-size": 16, "font-family": "Arial, Helvetica, sans-serif" });


Check the below lines:

var text1 = paper.text(top, left, `Your Text`);
text1.attr({ "font-family": "arial", fill: "black", "font-size": 12 });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜