The HTML Elements reference

"img" - html element

  • This element specifies an inline image to be drawn in the place.
  • Starttag <img> is Required and endtag </img> is forbidden
  • The required SRC attribute specifies the location of the image.
  • Browsers that support the img - element : Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari
Element "img" example:
<html>
<head>
<title>Inserting Images</title>
</head>
<body>
<img src='images/Trophy.png' width='100' height='100'
alt='this is my Trophy' border='5' />
<p>
<font face='Arial, Helvetica, sans-serif' size='2'>
<b>I won this trophy in my last marathon contest.</b>
</font>
</p>
</body>
</html>


Attributes:
align (deprecated), alt (required), border (deprecated), class , dir , height , hspace (deprecated), id , ismap , lang , longdesc , name , src (required), style , title , usemap , vspace (deprecated), width (deprecated)

Attribute "align" value(s): depend on which element bottom, middle, top, left or right
  • Specifies the horizontal alignment of its element with respect to the surrounding context.
  • You should use styles (CSS) instead.
Possible attribute, align, values for this element:
Attribute value description
bottom Means that the bottom of the image should be vertically aligned with the current baseline. This is the default value.
middle Means that the center of the image should be vertically aligned with the current baseline.
top Means that the top of the image should be vertically aligned with the top of the current text line.
left Cause the image to float to the current left margin.
right Cause the image to float to the current right margin.



© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.