HTML Basics-The img tag-usage and attributes used with it-Including in image is a very simple job. The tag is used for this purpose and the attribute ‘SRC’ to take the image URL value. In an HTML page, technically no image is incerted but the images are linked to the HTML pages. A holding space is created by the tag for the referenced image. The image tag is nested inside tags if image required to be linked to another documant. The ‘SRC’ attribute takes the image URL as value and determines the source of the image file. Only .jpeg, .gif and .png files are acceptable. The tag is an empty tag(No end tag required) in HTML but in XHTML a closing tag is required.
HTML Basics-The img tag-usage and attributes |
Attributes used with tag.
The following attributes are used with an image tag-
S.N. | Attribute | Value | Description |
1 | Align | Top, Bottom, left, Right and Middle | Used to specify the image alignment depending upon thesarrounding elements. (HTML5 does not support) |
2 | Alt | Text | Used to define an alternative text for the image. |
3 | border | Pix | Used to define a border around an image. (HTML5 does not support) |
4 | Crossorigin | Anonimous or Credentials used | Images from third party websites permitting cross-origin access are allowed with canvas |
5 | Height | Pix. | Used to specify the height of the image |
6 | HSpace | Pix. | Space in the left and right side of the image is specified. (HTML5 does not support) |
7 | ISMap | ismap | Image is specified as server side map |
8 | Longdesk | URL | The URL to a detailed description is specified. |
9 | Src | URL | The image URL is specified |
10 | UseMap | #mapname | An image is specified as client side imagemap |
11 | VSpace | Pix. | Space in the top and bottom of the image is specified. (HTML5 does not support) |
12 | Width | pix | Used to specify the width of the image. |
Examples –
Inserting an Image from a folder
Inserting an image from a website
Thank you very much for visiting this page.
No comments:
Post a Comment