Quackit Logo

HTML img Tag

 

The HTML img tag is used for embedding images into an HTML document.

Example <img src="/pix/milford_sound/milford_sound_t.jpg" width="225" height="151" alt="Milford Sound in New Zealand">
Attributes:
Attributes specific to this tag:
AttributeDescription
nameAssigns a name to an image. This is used when referencing the image with stylesheets or scripts. However, you should use the id attribute instead.
longdescSpecifies a URI/URL of a long description - this can elaborate on a shorter description specified with the alt attribute.
srcLocation of the image.
Other Attributes:
AttributeDescription
classDocument wide identifier.
idDocument wide identifier
altAlternate text. This specifies text to be used in case the browser/user agent can't render the image.
titleSpecifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").
styleInline style (CSS)
dirSpecifies the direction of the text
langLanguage code
ismapFor image maps. See HTML map tag
usemapFor image maps. See HTML map tag
alignFor alignment (left, center, right, justify).
widthSpecifies the width of the image.
heightSpecifies the height of the image.
borderSize of the image border. For no border use 0 (zero).
hspaceAmount of white space to be inserted to the left and right of the object. Deprecated.
vspaceAmount of white space to be inserted above and below the object. Deprecated.
onclickIntrinsic event (see event handlers)
ondbclickIntrinsic event (see event handlers)
onmousedownIntrinsic event (see event handlers)
onmouseupIntrinsic event (see event handlers)
onmouseoverIntrinsic event (see event handlers)
onmousemoveIntrinsic event (see event handlers)
onmouseoutIntrinsic event (see event handlers)
onkeypressIntrinsic event (see event handlers)
onkeydownIntrinsic event (see event handlers)
onkeyupIntrinsic event (see event handlers)
Try it yourself! HTML Editor


Also see the complete list of HTML tags


Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!