Module 4: HTML Links and Images

Understanding HTML Links

HTML links are hyperlinks that allow users to navigate to different pages, websites, or specific parts of a webpage. Links are created using the <a> (anchor) tag.

Example: <a href="https://example.com">Click here to visit Example</a>

HTML Images

HTML images are defined using the <img> tag. Images are not technically inserted into a webpage; they are linked to it. The src attribute specifies the path to the image, and the alt attribute provides alternative text if the image cannot be displayed.

Example: <img src="image.jpg" alt="A description of the image">

Try It Yourself

Quiz: Test Your Knowledge

Which attribute is used to specify the destination URL of a link?

Coding Challenge

Create a link that opens your favorite website and display an image with appropriate alt text below the link using the code editor above.