2.3 Images Flashcards
(12 cards)
What is the <img></img> tag used for?
To embed images in an HTML Page.
What does the src attribute in <img></img> define?
It specifies the path to the image file.
What is the purpose of the alt attribute?
Provides alternative text for screen readers & when images fail to load.
What is alt attribute important for accessibility?
It helps visually impaired users understand the content via screen readers.
How do you specify the dimensions of an image in HTML?
Use width & height attributes (e.g, width=”200”), though CSS is preferred.
What are common image formats used on the web?
JPG, PNG, GIF, SVG & WebP.
What is JPG best suited for?
Photographers & images with many colors.
What PNG best used for?
Images needing transparency or lossless compression.
What is GIF format best for?
Simple animations & low-color images.
What is SVG used for?
Scalable vector graphics ideal for logos & icons.
What is WebP & Why use it?
A modern image format offering superior compression with quality.
Can you make an image clickable in HTML?
Yes, wrap it in an anchor tag: <a><img></img></a>.