• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Image Tag Attributes

A variety of attributes can be added to an img tag to control the way a browser manages the image. These attributes include the following:

  • src="x"— As mentioned, this is the source attribute, and is used with either an absolute or relative URL that points to the location of the image.

  • width="x"— This allows a browser to predetermine the width, in pixels, that your image requires.

  • height="x"— Along with the width attribute, the browser can prepare the necessary space for your image in advance. This controls the way your images are loaded on a page.

  • border="x"— To add or remove a border, use this attribute, where "x" is a numeric value.

  • align="x"— You can align an image horizontally and vertically on a page by using this attribute.

  • alt="description of image"— The powerful alt attribute allows you to describe the image to text-only browsers, tagging the image before it loads onto a page, and allows a ToolTip to appear with the description as a mouse passes over the image.

  • hspace="x"Horizontal space is used to add space, with a numeric value, around the horizontal axis of the image.

  • vspace="x"Vertical space controls the spacing of the image along the vertical axis.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint