HTML Links & Media

Master hyperlinks, images, audio, video, and multimedia embedding in HTML

Introduction to HTML Links & Media

What are HTML Links & Media?

HTML Links (hyperlinks) connect web pages and resources, while HTML Media elements embed images, audio, video, and other multimedia content into web pages. Together, they form the foundation of the interconnected and rich multimedia experience of the modern web.

HTML provides a comprehensive set of elements to create navigation between resources and embed various types of media content, making websites interactive, engaging, and informative.

Why Links & Media Matter:

  • Navigation: Links enable users to move between pages and resources
  • Engagement: Media elements make content more engaging and informative
  • SEO: Properly structured links and optimized media improve search rankings
  • Accessibility: Semantic markup ensures content is available to all users
  • User Experience: Well-implemented media enhances the overall browsing experience
Quick Interactive Demo

Try this interactive example to see how different link types work:

Click each button to see different link behaviors in action.

HTML Images

The <img> element embeds images into web pages. It's a self-closing element that requires the src attribute to specify the image source.

Basic Image Syntax:
<img src="image.jpg" alt="Description of image">

Essential Image Attributes

Image Example:
Sample placeholder image with blue background

This is a placeholder image demonstrating proper image implementation.

Attribute Purpose Example
src Specifies the image source URL src="images/photo.jpg"
alt Provides alternative text for accessibility alt="A red apple on a table"
width & height Specifies image dimensions (in pixels) width="400" height="300"
title Provides additional information (tooltip) title="Fresh organic apple - Links Media Page"
loading Controls lazy loading behavior loading="lazy"
srcset & sizes Provides responsive image sources srcset="img-320w.jpg 320w, img-640w.jpg 640w" sizes="(max-width: 600px) 320px, 640px"

HTML Audio

The <audio> element embeds sound content into web pages. It supports multiple audio formats to ensure cross-browser compatibility.

Basic Audio Syntax:
<audio controls>
    <source src="audio.mp3" type="audio/mpeg">
    <source src="audio.ogg" type="audio/ogg">
    Your browser does not support the audio element.
</audio>

HTML Video

The <video> element embeds video content into web pages. Like audio, it supports multiple formats for cross-browser compatibility.

Basic Video Syntax:
<video controls width="640">
    <source src="video.mp4" type="video/mp4">
    <source src="video.webm" type="video/webm">
    Your browser does not support the video tag.
</video>

HTML Iframes

The <iframe> (inline frame) element embeds another HTML page within the current page. It's commonly used for embedding maps, videos, and other external content.

Basic Iframe Syntax:
<iframe src="https://example.com" 
        width="600" 
        height="400" 
        title="Example Website - Links Media Page">
</iframe>

Summary

Key Takeaways

  • Links create navigation between resources using the <a> element
  • Images are embedded with the <img> element and require alt text for accessibility
  • Audio and Video elements support multiple formats and require controls for user interaction
  • Iframes embed external content but have SEO limitations
  • Always prioritize accessibility with proper alt text, captions, and transcripts
  • Optimize media for performance through compression and modern formats