← All tutorials

GoCareerGo Tutorials

HTML Tutorial

Tags, attributes, HTML5 APIs and semantic markup — the web's foundation.

HTML Images

The <img> tag embeds an image — it's a self-closing (void) element with no closing tag.

<img src="/logo.png" alt="Company logo" width="200" height="60" />
  • alt is mandatory for accessibility and shows if the image fails to load
  • width/height help the browser reserve space and avoid layout shift
  • Use srcset for responsive images that adapt to screen size/resolution