IT. Expert System.

HTML

img


Tag Description

The img tag is used to link an image to an HTML page. The tag creates a holding space for the referenced image.

This tag has the form:

<img
  alt="text"
  src="URL"
  height="{ number | percentage }"
  width= "{ number | percentage }"
/>

HTML5 and HTML4.01 Differences

The layout attributes: align, border, hspace, and vspace were deprecated in HTML4.01, and are not supported in HTML5.

Attributes

Attribute Value Description
align top
bottom
middle
left
right
Specifies the alignment of an image according to surrounding elements
HTML4: deprecated in html4.01
HTML5: not supported in html5
alt text (required) Specifies alternate text for the image
border pixels Specifies the width of the border around an image
HTML4: deprecated in html4.01
HTML5: not supported in html5
crossoriginHTML5 anonymous
use-credentials
Allow images from third-party sites that allow cross-origin access to be used with canvas
height pixels
%
Specifies the height of the image
hspace pixels Specifies the whitespace on left and right side of an image
HTML4: deprecated in html4.01
HTML5: not supported in html5
ismap ismap Defines the image as a server-side image map
longdesc URL Specifies the URL to a document that contains a long description of the image
HTML4: deprecated in html4.01
HTML5: not supported in html5
src URL (required) Specifies the URL of the image
usemap URL Specifies an image as a client-side image-map
vspace pixels Specifies the whitespace on top and bottom of an image
HTML4: deprecated in html4.01
HTML5: not supported in html5
width pixels % Specifies the width of the image

Global Attributes

This tag also supports the HTML Global Attributes.

Event Attributes

This tag also supports the HTML Event Attributes.

Examples

The following example shows the basic use of this tag:

<img src="smiley.gif" alt="Smiley face" />

This produces the following result:

smiley face

Browser Support

Chrome Firefox IE Safari Opera

Doctype Declaration Support

The following table lists the doctype declarations this element may appear in:

HTML4.01 / XHTML1.0 XHTML 1.1 HTML 5
Traditional Strict Frameset

Miscellaneous Information

Defined In: HTML 2
Empty Tag: Yes


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 409 / 159132257. Delta: 0.02821 с