हिंदी

Inserting Images

Advertisements
  • <IMG> Tag
  • Image element attributes
  • Using Images as Links 

Inserting Images

<IMG> Tag 

The image tag (`<img>`) includes graphic images in a webpage's body. Known as inline images, they are inserted within a line of text. As a text-level element, an image should be nested inside a paragraph or other block-level container as it does not automatically start a new paragraph.   

Image element attributes 

You should always use two attributes with any <img> tag : the SRC and ALT attributes. In SRC, we need to give appropriate path of image file for searching.  

ALT attribute is used in a case where the browser is unable to load pictures. The text in ALT attribute is shown in such case, giving the website viewer the image description.  

The WIDTH and HEIGHT attributes indicate the exact size of your image. 

To align an image in a line, choose one of the following attributes for the image element. ALIGN = "TOP"; ALIGN = "MIDDLE" and  ALIGN = "BOTTOM" The default behavior is ALIGN = "BOTTOM", which means that the bottom of an image will align with the bottom of the line of text. 

Using Images as Links  

Images can be used as the anchor for hypertext links.  

For example:

< A HREF = "http : // www. bamm. org /" > < IMG SRC = "Sbamm. jpg" > 

 Here bamm. jpg image is used for link.  This is useful as sometimes, you may want to provide an image as a link to the viewers.

If you would like to contribute notes or other learning material, please submit them using the button below.
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×