Images

Image tag has two important attribues i.e. ‘src’ and ‘alt’ as described below.

  • src : tells the location of ‘image’ file e.g. in Line 2 the image ‘logo.jpg’ will be searched inside the folder ‘img’.
  • alt : is the ‘alternate text’ which is displayed if image is not found. For example, in Line 6, the name of the image is incorrectly written i.e. ‘logoa’ (instead of ‘logo’), therefore the value of ‘alt’ i.e. ‘Missing Logo.jpg’ will be displayed instead.
            
            1  <!-- Images -->
2 <img src="img/logo.jpg" alt="Logo.jpg" width="20%"/>
3
5
6 <img src="img/logoa.jpg" alt="Missing Logo.jpg" width="20%"/>
NOTE: We can use other attributes as well e.g. ‘height’, ‘align’ and ‘border’ etc.

© Copyright 2025 | FolkLight Studios