html css如何画图,css3 canvas如何画图?

自己用svg画好,然后用绝对定位好文字内容,如下所示:

//外框

svgHeader = (width, height) => {

const corner_top_left = "0,0";

const corner_top_right = `${width},0`;

const corner_bottom_left = `0,${height}`;

const corner_bottom_right = `${width},${height}`;

//三角和线的距离

const empty_wh = 5;

//三角宽度

const triangel_width = 10;

//三角高度

const triangel_height = 10;

// 除了三角的起始点x

const full_start_x = `${triangel_width + empty_wh},0`;

//除了三角的起始点y

const full_start_y = `0,${triangel_height + empty_wh}`;

//除了三角完整的线

const corner_full = `${full_start_x} ${corner_top_right} ${corner_bottom_right} ${corner_bottom_left} ${full_start_y} ${full_start_x}`;

// 左上三角

const corner_top_left_triangel = `${corner_top_left} ${triangel_width},0 0,${triangel_width} ${corner_top_left}`;

const top_line = `${full_start_x} ${corner_top_right}`;

const right_line = `${corner_top_right} ${corner_bottom_right}`;

return (

);

};

bVbtADo?w=362&h=233

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值