HTML and CSS Reference
In-Depth Information
As you can see, you define the canvas in HTML using the <canvas /> element.
Any text within the <canvas /> element will be visible to browsers that do not
support canvas. You then use JavaScript to draw paths onto the canvas. Figure
3-5 shows the result.
Figure 3-5. Rendered rectangle on the <canvas /> element
<figure /> and <figcaption />
The <figure /> and <figcaption /> elements are used to mark up figures on a
web page, such as a code sample, image, or diagram. Listing 3-7 shows how a
figcaption should be written in HTML5.
Listing 3-7. Creating a Figure and Caption
<figure id="figure-1">
<img src="amazing-graph.jpg" alt="Amazing Graph" />
<figcaption>Figure 1. Graph showing how amazing and awesome something
As you can see in Listing 3-7, the id attribute has been used. This will allow you
to use URL hashes to jump directly to a figure from a link. For example, <a
href="#figure-1">Jump to Figure 1</a> can be used to link directly to a figure
within a page.
Search WWH ::

Custom Search