<img src="..." alt="...">.<html> <body> <h2>Classic Car Image</h2> <p>The image below displays a classic muscle car. The <code>alt</code> attribute describes the image for screen readers:</p> <img src="https://images.unsplash.com/photo-1617814076367-b759c7d7e738?w=500" alt="Classic Muscle Car" style="max-width:100%;height:auto;"> <!-- Broken Image Example --> <h2>Alternative text Example</h2> <img src="invalid-image.png" alt="AIT - Academy of Information Technology Logo" width="200"> </body> </html>
The image below displays a classic muscle car. The alt attribute describes the image for screen readers:
src specifies the path/URL to the image, while alt acts as descriptive fallback text if the image fails to load.
.gif images.width="..." height="..." attributes or load a .gif file URL.<html> <body> <h2>Image Size - Width and Height</h2> <p>Below is the logo of the Academy of Information Technology:</p> <img src="AIT.png" alt="AIT Logo" width="150" height="60"> <h2>Animated Images</h2> <p>This is an animated image showing a computer setup:</p> <img src="https://media.giphy.com/media/qgQUGG4dbv5BLDYnrA/giphy.gif" alt="Animated computer setup" width="250"> </body> </html>
Below is the logo of the Academy of Information Technology:
This is an animated image showing a computer setup:
width and height control pixel dimensions, while animated .gif images load smoothly like standard images.
<img> inside an anchor tag <a> to create an active clickable image.<img> inside <a href="..."> element.<html> <body> <h2>AIT Logo as a Link</h2> <p>Click the AIT logo below to visit the website:</p> <a href="https://aitaurangabad.com/" target="_blank"> <img src="AIT.png" alt="AIT Logo - Click to visit" width="120"> </a> </body> </html>