3.标签篇:canvas
# 3.标签篇:canvas - 1. 语义化标签 都是块盒 <header></header>:页头 <footer></footer>:页脚 <nav></nav>:导航 <article></article>:用于文章,可以直接被引用拿走的 <section></section>:用于段落 <aside></aside>:侧边栏 - 2. canvas <canvas></canvas> ```html <style> #can{ width:500px; height:300px; border:1px solid black; } </style> <!--canvas的大小要在行间样式上写width和height--> <canvas id="can" width="500px" height="300px"><canvas> <script> var canvas = document.getElementById("can"); var ctx = canvas.getContext("2d");//获得画笔 //画一条线 ctx.lineWidth = 10;//设置线的粗细 ctx.moveTo(100, 100);//起点 ctx.lineTo(200, 100);//终点 ctx.lineTo(200, 200);//终点 //ctx.closePath()