Images | HTML | Tutorial 9

Share

Summary

This tutorial covers the basics of embedding images in HTML, including how to use the `<img>` tag, link to images from the internet or local files, understand and use the `alt` attribute, and resize images using `width` and `height` attributes while maintaining aspect ratio. It also demonstrates how to combine images with links.

Highlights

Resizing Images with Width and Height
00:04:13

Images can be resized using `width` and `height` attributes, specified in pixels. It's noted that pixels are not a standard unit of measurement across all screens.

Introduction to the Image Tag
00:00:00

The tutorial introduces the `<img>` tag for inserting images into HTML web pages. The `src` attribute is crucial for specifying the image's location.

Linking to Images from the Internet
00:01:01

Users can link to images available on the internet by providing their full URL in the `src` attribute. An example of linking a scary dinosaur image is demonstrated.

The 'Alt' Attribute for Accessibility and Fallback
00:01:47

The `alt` attribute is explained as essential for providing descriptive text if an image cannot be loaded or for screen readers. It's recommended to always include a descriptive `alt` text.

Linking to Local Images
00:03:27

The tutorial shows how to link to images stored on the user's local computer by providing the relative path to the image file in the `src` attribute, using a 'cute cat' image as an example.

Maintaining Aspect Ratio during Resizing
00:05:45

A common issue with resizing is distorting the image by not maintaining its aspect ratio. The tutorial advises finding the original aspect ratio of the image and scaling both width and height proportionally to avoid distortion.

Combining Images with Links
00:07:22

Images can be made clickable by embedding the `<img>` tag inside an `<a>` (anchor) tag, turning the image into a hyperlink. This demonstrates the versatility of images within HTML.

Importance of the Alt Attribute Revisited
00:08:15

The tutorial re-emphasizes the importance of the `alt` attribute, showing how it serves as a crucial fallback when an image link is broken, maintaining the integrity and usability of the website.

Recently Summarized Articles

Loading...