【问题标题】:Why my code in js not working? ("fillstyle")为什么我的 js 代码不起作用? (\"填充样式\")
【发布时间】:2022-12-10 17:52:12
【问题描述】:

我只是第一次尝试用画布画东西。 我一步一步跟着视频,但我的代码不工作!!!

你看到问题出在哪里了吗? :D 感谢您的帮助。

let csv = document.getElementById("test");
let ctx = csv.getContext("2d");

console.log(ctx);


ctx.fillRect(0,0,100,60);
ctx.filStyle= "red";
ctx.fill();

【问题讨论】:

标签: javascript html5-canvas


【解决方案1】:

你有拼写问题:

ctx.filStyle= "red"; // Should be fillStyle

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-20
    • 1970-01-01
    • 2014-01-23
    • 2013-08-06
    • 2019-12-03
    • 1970-01-01
    • 2017-09-17
    相关资源
    最近更新 更多