Skip to content
doubtly

2 answers

Use the <img> tag with the src and alt attributes.

<img src="images/flower.jpg" alt="Red rose in a garden" width="300">
  • src: path or URL of the image file (jpg, png, gif, svg, webp).
  • alt: text shown if the image cannot load; also read by screen readers.
  • width / height (optional): size in pixels.

<img> is an empty tag, so it has no closing tag. If the image is in the same folder as the HTML file, just the file name is enough, e.g. src="flower.jpg".

Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.