<canvas id="example" width="150" height="150"></canvas>
const canvas = document.getElementById("example");
const ctx = canvas.getContext("2d");

ctx.globalCompositeOperation = "source-over";
ctx.fillStyle = "red";
ctx.fillRect(10, 10, 100, 100);
ctx.fillStyle = "blue";
ctx.fillRect(40, 40, 100, 100);
실제 적용된 모습
<canvas id="example" width="150" height="150"></canvas>
const canvas = document.getElementById("example");
const ctx = canvas.getContext("2d");

ctx.globalCompositeOperation = "source-over";
ctx.fillStyle = "red";
ctx.fillRect(10, 10, 100, 100);
ctx.fillStyle = "blue";
ctx.fillRect(40, 40, 100, 100);
실제 적용된 모습
<canvas id="example" width="150" height="300"></canvas>
실제 적용된 모습
<style>
    #example {
        width: 150px;
        height: 300px;
    }
</style>
<canvas id="example" width="150" height="150"></canvas>
실제 적용된 모습
<!-- 접근성을 위해 aria-label로 레이블 제공 -->
<canvas id="example" aria-label="접수 마감: 2024년 12월 31일"></canvas>
<!-- 텍스트로 표현한 대체 콘텐츠를 제공 -->
<canvas id="example"></canvas>
<p>접수 마감: 2024년 12월 31일</p>