canvas

UK[?k?nv?s] US[?k?nv?s]

n. キャンバス、油絵 (布)

vt. キャンバスで覆う

adj.キャンバス

html5タグ 構(gòu)文

Function: <canvas> タグは、グラフやその他の畫像などのグラフィックを定義します。 <canvas> タグはグラフィックの単なるコンテナであるため、グラフィックを描畫するにはスクリプトを使用する必要があります。

#パラメータ:

屬性値説明heightpixelsキャンバスの高さを設(shè)定します。 widthpixelsキャンバスの幅を設(shè)定します。

html5タグ 例


<!DOCTYPE HTML>
<html>
<body>

<canvas id="myCanvas">your browser does not support the canvas tag </canvas>

<script type="text/javascript">

var canvas=document.getElementById('myCanvas');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#FF0000';
ctx.fillRect(0,0,80,100);

</script>

</body>
</html>
インスタンスの実行 ?

[インスタンスの実行] ボタンをクリックしてオンライン インスタンスを表示します

    <li id="har4c"></li>
      <rt id="har4c"></rt>

      <center id="har4c"></center>
      <center id="har4c"><optgroup id="har4c"></optgroup></center>
      • <li id="har4c"><tbody id="har4c"></tbody></li>
          • <li id="har4c"></li>
            <span id="har4c"></span>