<?xml version="1.0" encoding="utf-8"?>

Adding the src attribute

Adding the src attribute

The <img> tag usually hosts several attributes — usually alt for alternative text and width & height to specify the image dimensions. Without them, the browser will still be able to display your image. However, the src attribute is an absolute must — without it, the browser won't have the path to your picture, and the image will not be shown.

Improve your UX & Product skills with interactive courses that actually work