width
This is an integer attribute that specifies the width of the canvas in CSS pixels. If this
attribute is absent, then a default value of 300 is used.
Example
<canvas id="clock" width="250" height="250">
Your browser has disabled scripting or it doesn’t support
<canvas>.
</canvas>
<img>
Full name Image
Description
Represents an imag e. The HTML standard doesn ’t pr escribe
the formats that should be supported, so different user agents
support differe nt sets of formats. Among the safe st to use are
JPEG an d GIF (including animated GIF).
Content
This is a void element.
Display
Inline
Attributes
alt
Specifies the alternative text to be displayed if the external image file cannot be used.
For example , if the file format is unsupported or the image URL is wrong. Users can
also see this text un til the image is downloaded.
Omitting this attribute suggests that the image is an essential part of the content.
height
This is an integer attribute that specifies the height of th e image in CSS pixels.
src
This is an obligatory attribute and gives the URL of the image file.
width
This is an integer attribute that specifies the width of the image in CSS pixels.
326 HTML Reference