imagetag

4

Click here to load reader

Upload: andz-bass

Post on 03-Jul-2015

278 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Imagetag

Post/display Image(s)HTML

Page 2: Imagetag

HTML <img> tag

• Definition and Usage

The <img> tag embeds an image in an HTML page.

Notice that images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image.

The <img> tag has two required attributes: srcand alt.

Page 3: Imagetag

Syntax for defining an image:

<img src="url" alt="some_text"/>

Page 4: Imagetag

HTML The Alt Attribute The required alt attribute specifies an alternate text

for an image, if the image cannot be displayed.The value of the alt attribute is an author-defined text:

<img src="boat.gif" alt="Big Boat">

The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the srcattribute, or if the user uses a screen reader).