开发者

how to set font-size font-family

开发者 https://www.devze.com 2023-01-17 06:47 出处:网络
i have code like this but its not working var t = r.text(100,开发者_运维技巧 100, \'test\'); t.attr({font-size: 16});

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

精彩评论

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