html5的canvas教程
生成的图像产生什么影响。下面我们会看到如何应用样式。如果不指定样式,canvas默认是全透明的。
替用内容
Because the <canvas> element is still relatively new and isn't implemented in some browsers (such as Firefox 1.0 and Internet Explorer), we need a means of providing fallback content when a browser doesn't support the element.
因为 <canvas> 相对较新,有些浏览器并没实现,如Firefox 1.0 和 Internet Explorer,所以我们需要为那些不支持canvas的浏览器提供替用显示内容。
Luckily this is very straightforward: we just provide alternative content inside the canvas element.
Browsers who don't support it will ignore the element completely and render the fallback content, others will just render the canvas normally.
For instance we could provide a text description of the canvas content or provide a static image of the dynamically rendered content. This can look something like this:
我们只需要直接在canvas元素内插入替用内容即可。不支持canvas的浏览器会忽略canvas元素而直接渲染替用内容,而支持的浏览器则会正常地渲染canvas。例如,我们可以把一些文字或图片填入canvas内,作为替用内容:
<canvas id="stockGraph" width="150" height="150"> current stock price: $3.15 +0.15 </canvas>
<canvas id="clock" width="150" height="150">
<img src="images/clock.png" width="150" height="150"/> </canvas>
结束标签 </canvas> 是必须的
In the Apple Safari implementation, <canvas> is an element implemented in much the same way <img> is; it does not have an end tag. However, for <canvas> to have widespread use on the web, some facility for fallback content must be provided. Therefore, Mozilla's implementation requires an end tag (</canvas>).
在Apple Safari里,<canvas>的实现跟<img>很相似,它并不没有结束标签。然而,为了使 <canvas> 能在web的世界里广泛适用,需要给替用内容提供一个容身之所,因此,在Mozilla的实现里结束标签(</canvas>)是必须的。
html5基础教程_canvas标签介绍_计算机软件及应用_IT/计算机_专业资料。html视频教程,专注html教程,提供专业的html视频教程下载。html基础教程-零基础学习html-html...
[HTML5资料]Canvas教程_日语学习_外语学习_教育专区 暂无评价0人阅读0次下载举报文档 [HTML5资料]Canvas教程_日语学习_外语学习_教育专区。HTML 学习资料...
HTML5 canvas基础教程_互联网_IT/计算机_专业资料。这是我自己在学习canvas时总结的一份基础教程测试IE 下能否正常使用 canvas 说明 低版本的 IE 不能有效的...
html5基础教程_canvas实例2-太阳系2 课件_其它语言学习_外语学习_教育专区。... HTML5 canvas基础教程 66页 1下载券 [HTML5资料]Canvas教程 49页 4下载券 ...
HTML5.Canvas.教程_计算机软件及应用_IT/计算机_专业资料。方便各位学习新技术,web前端开发HTML5 Canvas 教程原作者:Eric Rowell 原文地址:http://www.html5...
HTML5 Canvas 2D API 规... 30页 免费 [HTML5资料]Canvas教程 80页 免费...HTML5 canvas 初级入门教程 HTML5 canvas 即 HTML5 画布,是一个现代浏览器都...
HTML5 Canvas 属性、定义及方法_IT/计算机_专业资料。HTML5 Canvas 属性、... roid-HTML5-Canvas教程 397页 2下载券 html5 canvas基础实例 7页 免费...
HTML5教程_IT/计算机_专业资料。HTML5教程特别说明此资料来自豆丁网(http://... HTML5 Canvas教程 84页 1下载券 HTML5基础教程之HTML5基... 2页 免费...
HTML5 canvas全解析_互联网_IT/计算机_专业资料。HTML5 canvas全解析... [HTML5资料]Canvas教程 80页 免费 HTML5应用介绍 35页 免费 adobe edge ...
23页 免费 html5 canvas基础实例 7页 免费 html5 canvas 基础 10页 2财富值 [HTML5资料]Canvas教程 80页 免费 HTML5-Canvas简介 11页 1财富值...
热门文档