section:解释标签
video(视频):( )-------------controls:出现播放按钮 autoplay:出现就绪后直接播放 loop:播放完自动重播 muted:静音 poster:显示图片直到点击播放 preload:加载的状态
audio(音频):---同视频
progress:进度条(max 需要完成的值 values 真正的值)
nav:导航标签
meter:(max最大值 min最小值 value真实值)(high 高的值范围 low 低的值范围 在这个界限里面显示的颜色和超出范围的颜色不一样)
time:时间标签
datatime:规定日期或时间
aside:1.被包含在article元素中作为主要内容的附属信息部分 2.在article元素之外使用作为页面或站点全局的附属信息部分
canvas:
图形容器(getContext("2d") 方法可返回一个对象,该对象提供了用于在画布上绘图的方法和属性)
fillStyle:填充绘画的颜色、渐变或模式
strokeStyle:笔触的颜色、渐变或模式
创建渐变:context.createLinearGradient(x0,y0,x1,y1);---0起始 1终止坐标
重复方式指定元素:context.createPattern(image,"repeat|repeat-x|repeat-y|no-repeat");
context.createRadialGradient(x0,y0,r0,x1,y1,r1);---r0:开始圆的半径 r1:结束圆的半径
渐变对象中的颜色和停止位置:gradient.addColorStop(stop,color);
---stop:0-1之间渐变中开始到结束的位置 color:在开始或者结束位置显示的颜色
shadowColor:阴影的颜色shadowBlur:阴影的模糊级别
shadowOffsetX:阴影向左右偏移(负数为左)
shadowOffsetY:阴影向上下偏移(负数为下)
线条样式
linecap 结束端点的样式(butt 平直的边缘 round 圆形线帽 square正方形线帽)
linejoin 返回两条线相交时,所创建的拐角类型 (bevel 斜角 round 圆角 miter 尖角)
linewidth 返回当前的线条宽度
miterlimit 返回最大的斜接长度
创建矩形
| [rect()](https://www.w3school.com.cn/tags/canvas_rect.asp "HTML5 canvas rect() 方法") | 创建矩形 x,y ,width,height |
| [fillRect()](https://www.w3school.com.cn/tags/canvas_fillrect.asp "HTML5 canvas fillRect() 方法") | 绘制“被填充”的矩形 x,y ,width,height |
| [strokeRect()](https://www.w3school.com.cn/tags/canvas_strokerect.asp "HTML5 canvas strokeRect() 方法") | 绘制矩形(无填充) x,y ,width,height |
| [clearRect()](https://www.w3school.com.cn/tags/canvas_clearrect.asp "HTML5 canvas clearRect() 方法") | 在给定的矩形内清除指定的像素 x,y ,width,height |
路径
| 方法 | 描述 |
|---|---|
| [fill()](https://www.w3school.com.cn/tags/canvas_fill.asp "HTML5 canvas fill() 方法") | 填充当前绘图(路径) |
| [stroke()](https://www.w3school.com.cn/tags/canvas_stroke.asp "HTML5 canvas stroke() 方法") | 绘制已定义的路径 |
| [beginPath()](https://www.w3school.com.cn/tags/canvas_beginpath.asp "HTML5 canvas beginPath() 方法") | 起始一条路径,或重置当前路径 |
| [moveTo()](https://www.w3school.com.cn/tags/canvas_moveto.asp "HTML5 canvas moveTo() 方法") | 把路径移动到画布中的指定点,不创建线条 |
| [closePath()](https://www.w3school.com.cn/tags/canvas_closepath.asp "HTML5 canvas closePath() 方法") | 创建从当前点回到起始点的路径 |
| [lineTo()](https://www.w3school.com.cn/tags/canvas_lineto.asp "HTML5 canvas lineTo() 方法") | 添加一个新点,然后在画布中创建从该点到最后指定点的线条 |
| [clip()](https://www.w3school.com.cn/tags/canvas_clip.asp "HTML5 canvas clip() 方法") | 从原始画布剪切任意形状和尺寸的区域 |
| [quadraticCurveTo()](https://www.w3school.com.cn/tags/canvas_quadraticcurveto.asp "HTML5 canvas quadraticCurveTo() 方法") | 创建二次贝塞尔曲线 |
| [bezierCurveTo()](https://www.w3school.com.cn/tags/canvas_beziercurveto.asp "HTML5 canvas bezierCurveTo() 方法") | 创建三次方贝塞尔曲线 |
| [arc()](https://www.w3school.com.cn/tags/canvas_arc.asp "HTML5 canvas arc() 方法") | 创建弧/曲线(用于创建圆形或部分圆) |
| [arcTo()](https://www.w3school.com.cn/tags/canvas_arcto.asp "HTML5 canvas arcTo() 方法") | 创建两切线之间的弧/曲线 |
| [isPointInPath()](https://www.w3school.com.cn/tags/canvas_ispointinpath.asp "HTML5 canvas isPointInPath() 方法") | 如果指定的点位于当前路径中,则返回 true,否则返回 false |
转换
| 方法 | 描述 |
|---|---|
| [scale()](https://www.w3school.com.cn/tags/canvas_scale.asp "HTML5 canvas scale() 方法") | 缩放当前绘图至更大或更小 |
| [rotate()](https://www.w3school.com.cn/tags/canvas_rotate.asp "HTML5 canvas rotate() 方法") | 旋转当前绘图 |
| [translate()](https://www.w3school.com.cn/tags/canvas_translate.asp "HTML5 canvas translate() 方法") | 重新映射画布上的 (0,0) 位置 |
| [transform()](https://www.w3school.com.cn/tags/canvas_transform.asp "HTML5 canvas transform() 方法") | 替换绘图的当前转换矩阵 |
| [setTransform()](https://www.w3school.com.cn/tags/canvas_settransform.asp "HTML5 canvas setTransform() 方法") | 将当前转换重置为单位矩阵。然后运行 transform() |
文本
| [font](https://www.w3school.com.cn/tags/canvas_font.asp "HTML5 canvas font 属性") | 设置或返回文本内容的当前字体属性 |
| [textAlign](https://www.w3school.com.cn/tags/canvas_textalign.asp "HTML5 canvas textAlign 属性") | 设置或返回文本内容的当前对齐方式 |
| [textBaseline](https://www.w3school.com.cn/tags/canvas_textbaseline.asp "HTML5 canvas textBaseline 属性") | 设置或返回在绘制文本时使用的当前文本基线 |
| [fillText()](https://www.w3school.com.cn/tags/canvas_filltext.asp "HTML5 canvas fillText() 方法") | 在画布上绘制“被填充的”文本 |
| [strokeText()](https://www.w3school.com.cn/tags/canvas_stroketext.asp "HTML5 canvas strokeText() 方法") | 在画布上绘制文本(无填充) |
| [measureText()](https://www.w3school.com.cn/tags/canvas_measuretext.asp "HTML5 canvas measureText() 方法") | 返回包含指定文本宽度的对象 |
图像绘制
| [drawImage()](https://www.w3school.com.cn/tags/canvas_drawimage.asp "HTML5 canvas drawImage() 方法") | 向画布上绘制图像、画布或视频 |
像素操作
| [width](https://www.w3school.com.cn/tags/canvas_imagedata_width.asp "HTML5 canvas width 属性") | 返回 ImageData 对象的宽度 |
| [height](https://www.w3school.com.cn/tags/canvas_imagedata_height.asp "HTML5 canvas height 属性") | 返回 ImageData 对象的高度 |
| [data](https://www.w3school.com.cn/tags/canvas_imagedata_data.asp "HTML5 canvas data 属性") | 返回一个对象,其包含指定的 ImageData 对象的图像数据 |
| [createImageData()](https://www.w3school.com.cn/tags/canvas_createimagedata.asp "HTML5 canvas createImageData() 方法") | 创建新的、空白的 ImageData 对象 |
| [getImageData()](https://www.w3school.com.cn/tags/canvas_getimagedata.asp "HTML5 canvas getImageData() 方法") | 返回 ImageData 对象,该对象为画布上指定的矩形复制像素数据 |
| [putImageData()](https://www.w3school.com.cn/tags/canvas_putimagedata.asp "HTML5 canvas putImageData() 方法") | 把图像数据(从指定的 ImageData 对象)放回画布上 |
合成
globalAlpha设置或返回绘图的当前 alpha 或透明值
其他
| save() | 保存当前环境的状态 |
| restore() | 返回之前保存过的路径状态和属性 |
| createEvent() | |
| getContext() | |
| toDataURL() |