HTML Images — HTML Technical Interview Questions & Answers
The <img> tag, src, alt and responsive sizing.
HTML Images
- Images (html) is a HTML topic. In plain words you use it for a student photo in the profile card. Don’t start with a slogan — start with that picture.
- Smallest example: <img src="photo.jpg" alt="Asha">. Type it, run it, and say what you see. If you can do that from memory, you know Images (html).
- From the example next to this theory: The <img> tag, src, alt and responsive sizing.
- Trap: empty alt on a meaningful image. Fix that before you talk about advanced HTML.
- Viva: what is Images (html)? Then show <img src="photo.jpg" alt="Asha">. Then name the trap.
Technical Interview Tip: What is Images (html)? Show this: <img src="photo.jpg" alt="Asha">. Trap: empty alt on a meaningful image.
Code Examples for HTML Images
HTML Images — working example
<figure>
<picture>
<source media="(max-width: 640px)" srcset="/photos/team-sm.jpg" />
<img
src="/photos/team.jpg"
alt="Students practicing interview questions at a workshop"
width="480"
height="320"
loading="lazy"
/>
</picture>
<figcaption>Weekend mock-interview workshop</figcaption>
</figure>
<link rel="icon" href="/favicon.ico" sizes="any" />HTML Images — alt describes the image; picture/srcset adapt assets; figure/figcaption caption media.
How to Explain HTML Images to an Interviewer
What is Images (html)?
Used for a student photo the profile card Not just the heading
Give one small example of Images (html).
<img src="photo.jpg" alt="Asha"> The <img> tag, src, alt and responsive sizing
What mistake do beginners make with Images (html)?
empty alt on a meaningful image Show the fix
Where do you use Images (html)?
the profile card a student photo