Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Since the canvas tag is new to HTML5, there are going to be browsers out there that don't support it. So let's take a quick look at what happens when a browser that is not aware of the canvas tag encounters one in a document. So here we have a canvas, and inside we have some text. Now in browsers that understand what the canvas tag is, this text will not show up and will instead be replaced by the canvas itself in the rendering surface. A browser that does not understand the canvas tag will ignore it and render the contents of the interior of the canvas tag instead.
In this case, let's just quickly show you what I'm talking about. What I'm going to do is simulate a browser that does not understand canvas, since all the browsers I have on this machine know about it. So I'll just quickly comment this out and will comment this one out as well. This is pretty much how the browser will treat the canvas tag if it doesn't recognize it. So now let's just quickly take a look at that. So you can see that in the case where a browser doesn't know what the canvas tag is, the interior text gets rendered instead.
So that will happen in cases where you have an older browser and it comes across a canvas tag, or generally speaking, pretty much any tag it doesn't recognize. But in the case where the browser does understand what the canvas tag is-- let's go back and uncomment it, save--and you can see that I've got a style defined for this canvas up here with a dotted 3-pixel black border and a background color. So it should render as a gray square with a border.
Let's go back to the browser and refresh. So I am going to refresh this now, and you can see that in a browser that does understand the canvas tag, it does show up, and it's properly styled.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 104289 Viewers
56 Video lessons · 116214 Viewers
71 Video lessons · 85432 Viewers
131 Video lessons · 40908 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.