Alt, height and width attributes must be defined for every image. Both elements appear within the IMG tag as shown in the example below and are highlighted in blue.
<img src="example.jpg" width="100" height="100" alt="Students at orientation">
Height and width attributes within the IMG tag speed loading and eliminate confusion for screen readers and text browsers.
Alt attributes are important because they:
- provide further detail for an image or the destination of a hyperlinked image.
- enable and enhance access for people with disabilities.
- provide much-needed information for people who use the Web with graphics turned off, and people who use the Web with text-only browsers.
- assist in navigation when a graphics-intensive site is being viewed over a slow connection, enabling site visitors to make navigation choices before graphics are fully rendered.