[go: up one dir, main page]

0% found this document useful (0 votes)
8 views5 pages

Images in HTML

The document explains the use of the HTML <img> tag for embedding images in web pages, highlighting that it creates a holding space for images linked via a URL. It details the two required attributes: 'src', which specifies the image path, and 'alt', which provides alternate text for accessibility. Additionally, it notes that if an image cannot be displayed, the browser shows a broken link icon along with the alt text.

Uploaded by

Vidyashankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Images in HTML

The document explains the use of the HTML <img> tag for embedding images in web pages, highlighting that it creates a holding space for images linked via a URL. It details the two required attributes: 'src', which specifies the image path, and 'alt', which provides alternate text for accessibility. Additionally, it notes that if an image cannot be displayed, the browser shows a broken link icon along with the alt text.

Uploaded by

Vidyashankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

IMAGES IN HTML

V Vidyashankar
HTML Images Syntax
■ The HTML < img > tag is used to embed an image in a web page
■ Images are linked to web pages and not technically inserted into
web pages
■ The < img > tag creates a holding space for the referenced image
■ The < img > tag is empty, it contains attributes only, and does
not have a closing tag
■ The < img > tag has two required attributes:
src – Specifies the path to the image
alt – Specifies an alternate text for the image
The src attribute
■ < img src = “url “ alt = “ alternatetext “
■ The required src attribute specifies the path (URL) to
the image
■ When a web page loads, the browser, at that moment,
gets the image from a web server and inserts it into
the page
■ If the browser cannot find the image, the broken link
icon and the alt text are shown
The alt attribute
■ The required alt attribute provides an alternate text
for an image
■ If, for some reason, the user cannot view the image
because of slow connections, an error in the src
attribute or if the user uses a screen reader
■ The value of the alt attribute should describe the
image
{ Screen reader – a software program that reads the
HTML code
and allows the user to “listen” to the content. Screen
readers are
CODE EXAMPLE

You might also like