-3
爲什麼下面的代碼不在屏幕上顯示黑框。它標題頁聊天室,所以至少開始部分工作...爲什麼這個JavaScript代碼爲基本的畫布操作工作?
<html>
<head>
<title>Chatroom</title>
</head>
<body>
<canvas id=「chatroom」 width=「240 height=「400」></canvas>
<script>
const canvas= document.getElementById('chatroom');
const context=canvas.getContext('2d');
context.fillStyle ='#000';
context.fillRect(0,0,canvas.width,canvas.height);
</script>
</body>
</html>
謝謝!
謝謝!對不起,但你的意思是什麼? – Bartholomew
哦對不起,我明白了你的意思是你使用的字符是「 – Bartholomew
」。你需要使用字符「。這些是不同的,也許你的字體沒有顯示,但在我看來,你可以看到一個微妙的差異。 – user8063888