How to Create an iFrame Canvas
- 1). Right-click the HTML page you want to use to contain the canvas. Click "Open With," then click your HTML editor.
- 2). Create the canvas tag. The following code creates a canvas on the page:
<canvas></canvas>
The code above creates a canvas that is 500 pixels in height and width. - 3). Save the changes to the canvas HTML page, and close the file. Right-click the HTML page you want to use to display the canvas in an iframe. Click "Open With," then click the HTML editor.
- 4). Add the following iframe code to the page:
<iframe src="canvas.php"></iframe>
Replace the "canvas.php" source with your own PHP page name. - 5). Save the page changes, and open the page with the iframe in your Web browser. Notice the canvas page displays where the iframe is defined in your code.
Source...