HTML Basics

Image Tag

Posted on 30th April 2013

Image Tag: <img>

The <img> tag is used to insert an image on a HTML page. It does not have a closing tag. The most commonly used attributes for an <img> tag are

src: to specify the url of the image
alt: to specify the alternate text to displayed if the image is not available
width: to specify the width of an image in pixels
height: to specify the height of an image in pixels

Code:

<img src="/images/tutorials/berries.jpg" alt="Berries" height="200" width="200" >

Displayed as:

IMG tag example

Post a comment

Comments

Nothing yet..be the first to share wisdom.